/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    'ap-northeast-1' = 'ccc.aliyuncs.com',
    'ap-south-1' = 'ccc.aliyuncs.com',
    'ap-southeast-1' = 'ccc.aliyuncs.com',
    'ap-southeast-2' = 'ccc.aliyuncs.com',
    'ap-southeast-3' = 'ccc.aliyuncs.com',
    'ap-southeast-5' = 'ccc.aliyuncs.com',
    'cn-beijing' = 'ccc.aliyuncs.com',
    'cn-chengdu' = 'ccc.aliyuncs.com',
    'cn-hongkong' = 'ccc.aliyuncs.com',
    'cn-huhehaote' = 'ccc.aliyuncs.com',
    'cn-qingdao' = 'ccc.aliyuncs.com',
    'cn-shenzhen' = 'ccc.aliyuncs.com',
    'cn-zhangjiakou' = 'ccc.aliyuncs.com',
    'eu-central-1' = 'ccc.aliyuncs.com',
    'eu-west-1' = 'ccc.aliyuncs.com',
    'me-east-1' = 'ccc.aliyuncs.com',
    'us-east-1' = 'ccc.aliyuncs.com',
    'us-west-1' = 'ccc.aliyuncs.com',
    'cn-hangzhou-finance' = 'ccc.aliyuncs.com',
    'cn-shenzhen-finance-1' = 'ccc.aliyuncs.com',
    'cn-shanghai-finance-1' = 'ccc.aliyuncs.com',
    'cn-north-2-gov-1' = 'ccc.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('ccc', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model DataPropertiesValue = {
  displayName?: string(name='DisplayName'),
  description?: string(name='Description', example='name'),
  name?: string(name='Name', example='name'),
  dataType?: string(name='DataType', example='string'),
  pattern?: string(name='Pattern', example='^'),
  patternErrorMessage?: string(name='PatternErrorMessage'),
  minLength?: int32(name='MinLength', example='1'),
  maxLength?: int32(name='MaxLength', example='10'),
  minimum?: double(name='Minimum', example='1'),
  maximum?: double(name='Maximum', example='10'),
  required?: boolean(name='Required', example='false'),
  system?: boolean(name='System', example='false'),
  disabled?: boolean(name='Disabled', example='false'),
  array?: boolean(name='Array', example='false'),
  readOnly?: boolean(name='ReadOnly', example='false'),
  editorType?: string(name='EditorType', example='textbox'),
  attributes?: string(name='Attributes', example='{}'),
  displayOrder?: int32(name='DisplayOrder', example='1'),
  createdTime?: long(name='CreatedTime', example='2021-07-14 10:48:43.0'),
  updatedTime?: long(name='UpdatedTime', example='2021-07-14 10:48:43.0'),
  creator?: string(name='Creator', example='tom'),
}

model DataSchemaPropertiesValue = {
  displayName?: string(name='DisplayName', example='name'),
  description?: string(name='Description', example='-'),
  name?: string(name='Name', example='name'),
  dataType?: string(name='DataType', example='string'),
  pattern?: string(name='Pattern', example='*'),
  patternErrorMessage?: string(name='PatternErrorMessage'),
  minLength?: int32(name='MinLength', example='1'),
  maxLength?: int32(name='MaxLength', example='1'),
  minimum?: double(name='Minimum', example='1'),
  maximum?: double(name='Maximum', example='1'),
  required?: boolean(name='Required', example='false'),
  system?: boolean(name='System', example='false'),
  disabled?: boolean(name='Disabled', example='false'),
  array?: boolean(name='Array', example='false'),
  readOnly?: boolean(name='ReadOnly', example='false'),
  editorType?: string(name='EditorType', example='textbox'),
  attributes?: string(name='Attributes', example='{}'),
  displayOrder?: int32(name='DisplayOrder', example='1'),
  createdTime?: long(name='CreatedTime', example='2020-10-14T09:53:53Z'),
  updatedTime?: long(name='UpdatedTime', example='2020-10-14T09:53:53Z'),
  creator?: string(name='Creator', example='tom'),
}

model AbortCampaignRequest {
  campaignId?: string(name='CampaignId', description='This parameter is required.', example='6badb397-a8b5-40b6-21019d382a09'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model AbortCampaignResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: string(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='7CC6523B-0E51-1B62-8DA5-6A9831CAE315'),
}

model AbortCampaignResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AbortCampaignResponseBody(name='body'),
}

/**
 * @summary 废弃预测式外呼活动
 *
 * @param request AbortCampaignRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AbortCampaignResponse
 */
async function abortCampaignWithOptions(request: AbortCampaignRequest, runtime: $RuntimeOptions): AbortCampaignResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.campaignId)) {
    query['CampaignId'] = request.campaignId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AbortCampaign',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 废弃预测式外呼活动
 *
 * @param request AbortCampaignRequest
 * @return AbortCampaignResponse
 */
async function abortCampaign(request: AbortCampaignRequest): AbortCampaignResponse {
  var runtime = new $RuntimeOptions{};
  return abortCampaignWithOptions(request, runtime);
}

model AcceptChatRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='chat-65382141036853491'),
}

model AcceptChatResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='2263B273-AC1B-44EB-BA98-87F2322C6780'),
}

model AcceptChatResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AcceptChatResponseBody(name='body'),
}

/**
 * @param request AcceptChatRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AcceptChatResponse
 */
async function acceptChatWithOptions(request: AcceptChatRequest, runtime: $RuntimeOptions): AcceptChatResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AcceptChat',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AcceptChatRequest
 * @return AcceptChatResponse
 */
async function acceptChat(request: AcceptChatRequest): AcceptChatResponse {
  var runtime = new $RuntimeOptions{};
  return acceptChatWithOptions(request, runtime);
}

model AddBlacklistCallTaggingRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', example='job-6582589278232****'),
  number?: string(name='Number', description='This parameter is required.', example='1764590****'),
}

model AddBlacklistCallTaggingResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', description='Id of the request', example='9FBA26B0-462B-4D77-B78F-AF35560DBC71'),
}

model AddBlacklistCallTaggingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddBlacklistCallTaggingResponseBody(name='body'),
}

/**
 * @summary 编辑呼入控制号码
 *
 * @param request AddBlacklistCallTaggingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddBlacklistCallTaggingResponse
 */
async function addBlacklistCallTaggingWithOptions(request: AddBlacklistCallTaggingRequest, runtime: $RuntimeOptions): AddBlacklistCallTaggingResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.number)) {
    query['Number'] = request.number;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddBlacklistCallTagging',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 编辑呼入控制号码
 *
 * @param request AddBlacklistCallTaggingRequest
 * @return AddBlacklistCallTaggingResponse
 */
async function addBlacklistCallTagging(request: AddBlacklistCallTaggingRequest): AddBlacklistCallTaggingResponse {
  var runtime = new $RuntimeOptions{};
  return addBlacklistCallTaggingWithOptions(request, runtime);
}

model AddCasesRequest {
  campaignId?: string(name='CampaignId', description='This parameter is required.', example='c58b9719-3bc3-441d-a4d3-fc0309ef7066'),
  caseList?: [ 
    {
      caller?: string(name='Caller'),
      customVariables?: string(name='CustomVariables'),
      maskedCallee?: string(name='MaskedCallee'),
      phoneNumber?: string(name='PhoneNumber', example='188888****'),
      referenceId?: string(name='ReferenceId', example='01'),
    }
  ](name='CaseList'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model AddCasesShrinkRequest {
  campaignId?: string(name='CampaignId', description='This parameter is required.', example='c58b9719-3bc3-441d-a4d3-fc0309ef7066'),
  caseListShrink?: string(name='CaseList'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model AddCasesResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: string(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='41298961-CAD7-5270-9378-FFD69F153144'),
}

model AddCasesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddCasesResponseBody(name='body'),
}

/**
 * @summary 追加联系人
 *
 * @param tmpReq AddCasesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddCasesResponse
 */
async function addCasesWithOptions(tmpReq: AddCasesRequest, runtime: $RuntimeOptions): AddCasesResponse {
  tmpReq.validate();
  var request = new AddCasesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.caseList)) {
    request.caseListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.caseList, 'CaseList', 'json');
  }
  var query = {};
  if (!$isNull(request.campaignId)) {
    query['CampaignId'] = request.campaignId;
  }
  if (!$isNull(request.caseListShrink)) {
    query['CaseList'] = request.caseListShrink;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddCases',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 追加联系人
 *
 * @param request AddCasesRequest
 * @return AddCasesResponse
 */
async function addCases(request: AddCasesRequest): AddCasesResponse {
  var runtime = new $RuntimeOptions{};
  return addCasesWithOptions(request, runtime);
}

model AddFeedbackRequest {
  feedback?: string(name='Feedback'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  rating?: int32(name='Rating', example='thumbsUp'),
  taskId?: string(name='TaskId', example='f780ade8-****-458b-b067-63077946a570'),
  taskName?: string(name='TaskName', example='Abstract:fields'),
}

model AddFeedbackResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='C81FD1A5-4B99-470A-A527-D80150228784'),
}

model AddFeedbackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddFeedbackResponseBody(name='body'),
}

/**
 * @param request AddFeedbackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddFeedbackResponse
 */
async function addFeedbackWithOptions(request: AddFeedbackRequest, runtime: $RuntimeOptions): AddFeedbackResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.feedback)) {
    query['Feedback'] = request.feedback;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.rating)) {
    query['Rating'] = request.rating;
  }
  if (!$isNull(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!$isNull(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddFeedback',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AddFeedbackRequest
 * @return AddFeedbackResponse
 */
async function addFeedback(request: AddFeedbackRequest): AddFeedbackResponse {
  var runtime = new $RuntimeOptions{};
  return addFeedbackWithOptions(request, runtime);
}

model AddNumbersToSkillGroupRequest {
  instNumberGroupIdList?: string(name='InstNumberGroupIdList'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  numberList?: string(name='NumberList', example='["0103182****","0102387****"]'),
  skillGroupId?: string(name='SkillGroupId', description='This parameter is required.', example='skillgroup@ccc-test'),
}

model AddNumbersToSkillGroupResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model AddNumbersToSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddNumbersToSkillGroupResponseBody(name='body'),
}

/**
 * @param request AddNumbersToSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddNumbersToSkillGroupResponse
 */
async function addNumbersToSkillGroupWithOptions(request: AddNumbersToSkillGroupRequest, runtime: $RuntimeOptions): AddNumbersToSkillGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instNumberGroupIdList)) {
    query['InstNumberGroupIdList'] = request.instNumberGroupIdList;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.numberList)) {
    query['NumberList'] = request.numberList;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddNumbersToSkillGroup',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AddNumbersToSkillGroupRequest
 * @return AddNumbersToSkillGroupResponse
 */
async function addNumbersToSkillGroup(request: AddNumbersToSkillGroupRequest): AddNumbersToSkillGroupResponse {
  var runtime = new $RuntimeOptions{};
  return addNumbersToSkillGroupWithOptions(request, runtime);
}

model AddPersonalNumbersToUserRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  numberList?: string(name='NumberList', description='This parameter is required.', example='["0101234****","0105678****"]'),
  userId?: string(name='UserId', description='This parameter is required.', example='agent@ccc-test'),
}

model AddPersonalNumbersToUserResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ string ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model AddPersonalNumbersToUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddPersonalNumbersToUserResponseBody(name='body'),
}

/**
 * @param request AddPersonalNumbersToUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddPersonalNumbersToUserResponse
 */
async function addPersonalNumbersToUserWithOptions(request: AddPersonalNumbersToUserRequest, runtime: $RuntimeOptions): AddPersonalNumbersToUserResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.numberList)) {
    query['NumberList'] = request.numberList;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddPersonalNumbersToUser',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AddPersonalNumbersToUserRequest
 * @return AddPersonalNumbersToUserResponse
 */
async function addPersonalNumbersToUser(request: AddPersonalNumbersToUserRequest): AddPersonalNumbersToUserResponse {
  var runtime = new $RuntimeOptions{};
  return addPersonalNumbersToUserWithOptions(request, runtime);
}

model AddPhoneNumberToSkillGroupsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  number?: string(name='Number', description='This parameter is required.', example='0101234****'),
  skillGroupIdList?: string(name='SkillGroupIdList', description='This parameter is required.', example='["skillgroup1@ccc-test","skillgroup2@ccc-test"]'),
}

model AddPhoneNumberToSkillGroupsResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model AddPhoneNumberToSkillGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddPhoneNumberToSkillGroupsResponseBody(name='body'),
}

/**
 * @param request AddPhoneNumberToSkillGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddPhoneNumberToSkillGroupsResponse
 */
async function addPhoneNumberToSkillGroupsWithOptions(request: AddPhoneNumberToSkillGroupsRequest, runtime: $RuntimeOptions): AddPhoneNumberToSkillGroupsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.number)) {
    query['Number'] = request.number;
  }
  if (!$isNull(request.skillGroupIdList)) {
    query['SkillGroupIdList'] = request.skillGroupIdList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddPhoneNumberToSkillGroups',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AddPhoneNumberToSkillGroupsRequest
 * @return AddPhoneNumberToSkillGroupsResponse
 */
async function addPhoneNumberToSkillGroups(request: AddPhoneNumberToSkillGroupsRequest): AddPhoneNumberToSkillGroupsResponse {
  var runtime = new $RuntimeOptions{};
  return addPhoneNumberToSkillGroupsWithOptions(request, runtime);
}

model AddPhoneNumbersRequest {
  contactFlowId?: string(name='ContactFlowId', example='dDMD_0mif4hv'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  numberGroupId?: string(name='NumberGroupId', example='2cb77c29-5f60-4b90-b21e-9d2ba9833f14'),
  numberList?: string(name='NumberList', example='["0101234****", "0105678****"]'),
  usage?: string(name='Usage', description='This parameter is required.', example='Bidirection'),
}

model AddPhoneNumbersResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ string ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model AddPhoneNumbersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddPhoneNumbersResponseBody(name='body'),
}

/**
 * @param request AddPhoneNumbersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddPhoneNumbersResponse
 */
async function addPhoneNumbersWithOptions(request: AddPhoneNumbersRequest, runtime: $RuntimeOptions): AddPhoneNumbersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactFlowId)) {
    query['ContactFlowId'] = request.contactFlowId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.numberGroupId)) {
    query['NumberGroupId'] = request.numberGroupId;
  }
  if (!$isNull(request.numberList)) {
    query['NumberList'] = request.numberList;
  }
  if (!$isNull(request.usage)) {
    query['Usage'] = request.usage;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddPhoneNumbers',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AddPhoneNumbersRequest
 * @return AddPhoneNumbersResponse
 */
async function addPhoneNumbers(request: AddPhoneNumbersRequest): AddPhoneNumbersResponse {
  var runtime = new $RuntimeOptions{};
  return addPhoneNumbersWithOptions(request, runtime);
}

model AddSchemaPropertyRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='b0eb2742-f37e-4c67-82d4-25c651c1xxxx'),
  property?: {
    array?: boolean(name='Array', example='false'),
    attributes?: string(name='Attributes'),
    dataType?: string(name='DataType', description='This parameter is required.', example='string'),
    description?: string(name='Description', example='-'),
    disabled?: boolean(name='Disabled', example='False'),
    displayName?: string(name='DisplayName', example='name'),
    displayOrder?: int32(name='DisplayOrder', example='10'),
    editorType?: string(name='EditorType', example='textbox'),
    maxLength?: int32(name='MaxLength', example='100'),
    maximum?: double(name='Maximum', example='1'),
    minLength?: int32(name='MinLength', example='1'),
    minimum?: double(name='Minimum', example='1'),
    name?: string(name='Name', description='This parameter is required.', example='name'),
    pattern?: string(name='Pattern', example='*'),
    patternErrorMessage?: string(name='PatternErrorMessage'),
    readOnly?: boolean(name='ReadOnly', example='true'),
    required?: boolean(name='Required', example='false'),
  }(name='Property'),
  requestId?: string(name='RequestId', example='03C67DAD-EB26-41D8-949D-9B0C470FB716'),
  schemaId?: string(name='SchemaId', description='schema id

This parameter is required.', example='profile'),
}

model AddSchemaPropertyShrinkRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='b0eb2742-f37e-4c67-82d4-25c651c1xxxx'),
  propertyShrink?: string(name='Property'),
  requestId?: string(name='RequestId', example='03C67DAD-EB26-41D8-949D-9B0C470FB716'),
  schemaId?: string(name='SchemaId', description='schema id

This parameter is required.', example='profile'),
}

model AddSchemaPropertyResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='BF268B34-09C2-43FD-BAC4-5D31EA633111'),
}

model AddSchemaPropertyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddSchemaPropertyResponseBody(name='body'),
}

/**
 * @param tmpReq AddSchemaPropertyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddSchemaPropertyResponse
 */
async function addSchemaPropertyWithOptions(tmpReq: AddSchemaPropertyRequest, runtime: $RuntimeOptions): AddSchemaPropertyResponse {
  tmpReq.validate();
  var request = new AddSchemaPropertyShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.property)) {
    request.propertyShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.property, 'Property', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.propertyShrink)) {
    body['Property'] = request.propertyShrink;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  if (!$isNull(request.schemaId)) {
    body['SchemaId'] = request.schemaId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddSchemaProperty',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AddSchemaPropertyRequest
 * @return AddSchemaPropertyResponse
 */
async function addSchemaProperty(request: AddSchemaPropertyRequest): AddSchemaPropertyResponse {
  var runtime = new $RuntimeOptions{};
  return addSchemaPropertyWithOptions(request, runtime);
}

model AddSkillGroupsToUserRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  skillLevelList?: string(name='SkillLevelList', description='This parameter is required.', example='[{"skillGroupId":"test1@ccc-test","skillLevel":5},{"skillGroupId":"test2@ccc-test","skillLevel":5}]'),
  userId?: string(name='UserId', description='This parameter is required.', example='agent@ccc-test'),
}

model AddSkillGroupsToUserResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA7F9545-8312-4190-9BD0-63144B3F1ACC'),
}

model AddSkillGroupsToUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddSkillGroupsToUserResponseBody(name='body'),
}

/**
 * @param request AddSkillGroupsToUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddSkillGroupsToUserResponse
 */
async function addSkillGroupsToUserWithOptions(request: AddSkillGroupsToUserRequest, runtime: $RuntimeOptions): AddSkillGroupsToUserResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.skillLevelList)) {
    query['SkillLevelList'] = request.skillLevelList;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddSkillGroupsToUser',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AddSkillGroupsToUserRequest
 * @return AddSkillGroupsToUserResponse
 */
async function addSkillGroupsToUser(request: AddSkillGroupsToUserRequest): AddSkillGroupsToUserResponse {
  var runtime = new $RuntimeOptions{};
  return addSkillGroupsToUserWithOptions(request, runtime);
}

model AddTicketTaskRequest {
  assignee?: string(name='Assignee', description='This parameter is required.', example='assignee@ccc-test'),
  comment?: string(name='Comment', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  position?: string(name='Position', example='After'),
  taskId?: string(name='TaskId', description='This parameter is required.', example='3b8c672f-48f6-45f5-bf41-9d4cb2b4a716'),
  ticketId?: string(name='TicketId', description='This parameter is required.', example='3d26b90a-c5d2-4b09-8219-********'),
}

model AddTicketTaskResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: any(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='B06B3244-1B44-481B-90C4-F2F92E59D6B5'),
}

model AddTicketTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddTicketTaskResponseBody(name='body'),
}

/**
 * @param request AddTicketTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddTicketTaskResponse
 */
async function addTicketTaskWithOptions(request: AddTicketTaskRequest, runtime: $RuntimeOptions): AddTicketTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.assignee)) {
    query['Assignee'] = request.assignee;
  }
  if (!$isNull(request.comment)) {
    query['Comment'] = request.comment;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.position)) {
    query['Position'] = request.position;
  }
  if (!$isNull(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!$isNull(request.ticketId)) {
    query['TicketId'] = request.ticketId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddTicketTask',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AddTicketTaskRequest
 * @return AddTicketTaskResponse
 */
async function addTicketTask(request: AddTicketTaskRequest): AddTicketTaskResponse {
  var runtime = new $RuntimeOptions{};
  return addTicketTaskWithOptions(request, runtime);
}

model AddUsersToSkillGroupRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  skillGroupId?: string(name='SkillGroupId', description='This parameter is required.', example='test1@ccc-test'),
  userSkillLevelList?: string(name='UserSkillLevelList', description='This parameter is required.', example='[{"userId":"agent1@ccc-test","skillLevel":10},{"userId":"agent2@ccc-test","skillLevel":10}]'),
}

model AddUsersToSkillGroupResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model AddUsersToSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddUsersToSkillGroupResponseBody(name='body'),
}

/**
 * @param request AddUsersToSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddUsersToSkillGroupResponse
 */
async function addUsersToSkillGroupWithOptions(request: AddUsersToSkillGroupRequest, runtime: $RuntimeOptions): AddUsersToSkillGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  if (!$isNull(request.userSkillLevelList)) {
    query['UserSkillLevelList'] = request.userSkillLevelList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddUsersToSkillGroup',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AddUsersToSkillGroupRequest
 * @return AddUsersToSkillGroupResponse
 */
async function addUsersToSkillGroup(request: AddUsersToSkillGroupRequest): AddUsersToSkillGroupResponse {
  var runtime = new $RuntimeOptions{};
  return addUsersToSkillGroupWithOptions(request, runtime);
}

model AnalyzeConversationRequest {
  contactId?: string(name='ContactId', example='job-10963442671187****'),
  fieldListJson?: string(name='FieldListJson'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='9cfad875-6260-4a53-ab6e-b13e3fb31f7d'),
  taskListJson?: string(name='TaskListJson', example='["keywords"]'),
}

model AnalyzeConversationResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='9F766284-F103-4298-8EC5-19F9F9BE5522'),
}

model AnalyzeConversationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AnalyzeConversationResponseBody(name='body'),
}

/**
 * @param request AnalyzeConversationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AnalyzeConversationResponse
 */
async function analyzeConversationWithOptions(request: AnalyzeConversationRequest, runtime: $RuntimeOptions): AnalyzeConversationResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactId)) {
    query['ContactId'] = request.contactId;
  }
  if (!$isNull(request.fieldListJson)) {
    query['FieldListJson'] = request.fieldListJson;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.taskListJson)) {
    query['TaskListJson'] = request.taskListJson;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AnalyzeConversation',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AnalyzeConversationRequest
 * @return AnalyzeConversationResponse
 */
async function analyzeConversation(request: AnalyzeConversationRequest): AnalyzeConversationResponse {
  var runtime = new $RuntimeOptions{};
  return analyzeConversationWithOptions(request, runtime);
}

model AnswerCallRequest {
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-65382141036853491'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model AnswerCallResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='INBOUND'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='INBOUND'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-653821410368****'),
          channelState?: string(name='ChannelState', example='ANSWERED'),
          channelVariables?: string(name='ChannelVariables'),
          destination?: string(name='Destination', example='1390501****'),
          index?: long(name='Index'),
          jobId?: string(name='JobId', example='job-6538214103685****'),
          originator?: string(name='Originator', example='0830019****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
          timestamp?: long(name='Timestamp', example='1609138903315'),
          userExtension?: string(name='UserExtension', example='8032****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    contextId?: long(name='ContextId', example='103655'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8032****'),
      heartbeat?: long(name='Heartbeat', example='1609136956378'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
      mobile?: string(name='Mobile', example='1324730****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1609136956378'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model AnswerCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AnswerCallResponseBody(name='body'),
}

/**
 * @param request AnswerCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AnswerCallResponse
 */
async function answerCallWithOptions(request: AnswerCallRequest, runtime: $RuntimeOptions): AnswerCallResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AnswerCall',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AnswerCallRequest
 * @return AnswerCallResponse
 */
async function answerCall(request: AnswerCallRequest): AnswerCallResponse {
  var runtime = new $RuntimeOptions{};
  return answerCallWithOptions(request, runtime);
}

model AppendCasesRequest {
  campaignId?: string(name='CampaignId', description='This parameter is required.', example='78cf6864-9a22-4ea8-a59d-5adc2d747b0e'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  body?: [ 
    {
      agentId?: string(name='AgentId', example='agent@ccc-test'),
      caller?: string(name='Caller', example='01012345678'),
      customVariables?: string(name='CustomVariables'),
      maskedCallee?: string(name='MaskedCallee', example='071*****801'),
      phoneNumber?: string(name='PhoneNumber', example='188888****'),
      referenceId?: string(name='ReferenceId', example='01'),
    }
  ](name='body'),
}

model AppendCasesShrinkRequest {
  campaignId?: string(name='CampaignId', description='This parameter is required.', example='78cf6864-9a22-4ea8-a59d-5adc2d747b0e'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  bodyShrink?: string(name='body'),
}

model AppendCasesResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: string(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BC976D32-AC4C-4E0F-8AA9-F4BC6C4E2B3E'),
}

model AppendCasesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AppendCasesResponseBody(name='body'),
}

/**
 * @summary 追加联系人
 *
 * @param tmpReq AppendCasesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AppendCasesResponse
 */
async function appendCasesWithOptions(tmpReq: AppendCasesRequest, runtime: $RuntimeOptions): AppendCasesResponse {
  tmpReq.validate();
  var request = new AppendCasesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.body)) {
    request.bodyShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.body, 'body', 'json');
  }
  var query = {};
  if (!$isNull(request.campaignId)) {
    query['CampaignId'] = request.campaignId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var body : map[string]any = {};
  if (!$isNull(request.bodyShrink)) {
    body['body'] = request.bodyShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'AppendCases',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 追加联系人
 *
 * @param request AppendCasesRequest
 * @return AppendCasesResponse
 */
async function appendCases(request: AppendCasesRequest): AppendCasesResponse {
  var runtime = new $RuntimeOptions{};
  return appendCasesWithOptions(request, runtime);
}

model AssignUsersRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  ramIdList?: string(name='RamIdList', description='This parameter is required.', example='["28036411123456****","29234301123456****"]'),
  roleId?: string(name='RoleId', description='This parameter is required.', example='Agent@ccc-test'),
  skillLevelList?: string(name='SkillLevelList', example='[{"skillGroupId":"skillgroup@ccc-test","skillLevel":5}]'),
  workMode?: string(name='WorkMode', description='This parameter is required.', example='ON_SITE'),
}

model AssignUsersResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='1ca2b084-6f0a-454b-9851-29768a9a5832'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
  workflowId?: string(name='WorkflowId', example='1ca2b084-6f0a-454b-9851-29768a9a5832'),
}

model AssignUsersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AssignUsersResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI AssignUsers is deprecated, please use CCC::2020-07-01::ImportRamUsers instead.
 *
 * @param request AssignUsersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AssignUsersResponse
 */
// Deprecated
async function assignUsersWithOptions(request: AssignUsersRequest, runtime: $RuntimeOptions): AssignUsersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ramIdList)) {
    query['RamIdList'] = request.ramIdList;
  }
  if (!$isNull(request.roleId)) {
    query['RoleId'] = request.roleId;
  }
  if (!$isNull(request.skillLevelList)) {
    query['SkillLevelList'] = request.skillLevelList;
  }
  if (!$isNull(request.workMode)) {
    query['WorkMode'] = request.workMode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AssignUsers',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @deprecated OpenAPI AssignUsers is deprecated, please use CCC::2020-07-01::ImportRamUsers instead.
 *
 * @param request AssignUsersRequest
 * @return AssignUsersResponse
 */
// Deprecated
async function assignUsers(request: AssignUsersRequest): AssignUsersResponse {
  var runtime = new $RuntimeOptions{};
  return assignUsersWithOptions(request, runtime);
}

model BargeInCallRequest {
  bargedUserId?: string(name='BargedUserId', description='This parameter is required.', example='agent2@ccc-test'),
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-6538214103685****'),
  timeoutSeconds?: int32(name='TimeoutSeconds', example='60'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model BargeInCallResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='BARGE'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='BARGE'),
          channelFlags?: string(name='ChannelFlags', example='MONITORING'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-653821410368****'),
          channelState?: string(name='ChannelState', example='ANSWERED'),
          destination?: string(name='Destination', example='1390501****'),
          index?: int32(name='Index', example='10'),
          jobId?: string(name='JobId', example='job-6538214103685****'),
          originator?: string(name='Originator', example='0830019****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
          timestamp?: long(name='Timestamp', example='1609138903315'),
          userExtension?: string(name='UserExtension', example='8032****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8032****'),
      heartbeat?: long(name='Heartbeat', example='1609136956378'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
      mobile?: string(name='Mobile', example='1324730****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1609136956378'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model BargeInCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BargeInCallResponseBody(name='body'),
}

/**
 * @param request BargeInCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BargeInCallResponse
 */
async function bargeInCallWithOptions(request: BargeInCallRequest, runtime: $RuntimeOptions): BargeInCallResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.bargedUserId)) {
    query['BargedUserId'] = request.bargedUserId;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.timeoutSeconds)) {
    query['TimeoutSeconds'] = request.timeoutSeconds;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BargeInCall',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request BargeInCallRequest
 * @return BargeInCallResponse
 */
async function bargeInCall(request: BargeInCallRequest): BargeInCallResponse {
  var runtime = new $RuntimeOptions{};
  return bargeInCallWithOptions(request, runtime);
}

model BlindTransferRequest {
  callPriority?: int32(name='CallPriority'),
  contactFlowVariables?: string(name='ContactFlowVariables'),
  deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-6538214103685****'),
  queuingOverflowThreshold?: long(name='QueuingOverflowThreshold'),
  queuingTimeoutSeconds?: long(name='QueuingTimeoutSeconds'),
  routingType?: string(name='RoutingType'),
  skillGroupId?: string(name='SkillGroupId'),
  strategyName?: string(name='StrategyName'),
  strategyParams?: string(name='StrategyParams'),
  tags?: string(name='Tags'),
  timeoutSeconds?: int32(name='TimeoutSeconds', example='60'),
  transferee?: string(name='Transferee', description='This parameter is required.', example='agent@ccc-test'),
  transfereeType?: string(name='TransfereeType'),
  transferor?: string(name='Transferor', example='08314325****'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model BlindTransferResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelFlags?: string(name='ChannelFlags', example='MONITORING'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-653821410368****'),
          channelState?: string(name='ChannelState', example='ANSWERED'),
          destination?: string(name='Destination', example='1390501****'),
          jobId?: string(name='JobId', example='job-6538214103685****'),
          originator?: string(name='Originator', example='0830019****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          timestamp?: long(name='Timestamp', example='1609138903315'),
          userExtension?: string(name='UserExtension', example='8032****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    contextId?: long(name='ContextId', example='103654'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8032****'),
      heartbeat?: long(name='Heartbeat', example='1609136956378'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
      mobile?: string(name='Mobile', example='1324730****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1609136956378'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model BlindTransferResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BlindTransferResponseBody(name='body'),
}

/**
 * @param request BlindTransferRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BlindTransferResponse
 */
async function blindTransferWithOptions(request: BlindTransferRequest, runtime: $RuntimeOptions): BlindTransferResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.callPriority)) {
    query['CallPriority'] = request.callPriority;
  }
  if (!$isNull(request.contactFlowVariables)) {
    query['ContactFlowVariables'] = request.contactFlowVariables;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.queuingOverflowThreshold)) {
    query['QueuingOverflowThreshold'] = request.queuingOverflowThreshold;
  }
  if (!$isNull(request.queuingTimeoutSeconds)) {
    query['QueuingTimeoutSeconds'] = request.queuingTimeoutSeconds;
  }
  if (!$isNull(request.routingType)) {
    query['RoutingType'] = request.routingType;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  if (!$isNull(request.strategyName)) {
    query['StrategyName'] = request.strategyName;
  }
  if (!$isNull(request.strategyParams)) {
    query['StrategyParams'] = request.strategyParams;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!$isNull(request.timeoutSeconds)) {
    query['TimeoutSeconds'] = request.timeoutSeconds;
  }
  if (!$isNull(request.transferee)) {
    query['Transferee'] = request.transferee;
  }
  if (!$isNull(request.transfereeType)) {
    query['TransfereeType'] = request.transfereeType;
  }
  if (!$isNull(request.transferor)) {
    query['Transferor'] = request.transferor;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BlindTransfer',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request BlindTransferRequest
 * @return BlindTransferResponse
 */
async function blindTransfer(request: BlindTransferRequest): BlindTransferResponse {
  var runtime = new $RuntimeOptions{};
  return blindTransferWithOptions(request, runtime);
}

model BridgeRtcCallRequest {
  callee?: string(name='Callee', description='This parameter is required.'),
  caller?: string(name='Caller'),
  deviceId?: string(name='DeviceId', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  serviceProvider?: string(name='ServiceProvider'),
  tags?: string(name='Tags'),
  timeoutSeconds?: int32(name='TimeoutSeconds'),
  userId?: string(name='UserId'),
  videoEnabled?: boolean(name='VideoEnabled'),
}

model BridgeRtcCallResponseBody = {
  code?: string(name='Code'),
  data?: {
    instanceId?: string(name='InstanceId'),
    jobId?: string(name='JobId'),
    tokenInfo?: string(name='TokenInfo'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId'),
}

model BridgeRtcCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BridgeRtcCallResponseBody(name='body'),
}

/**
 * @param request BridgeRtcCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BridgeRtcCallResponse
 */
async function bridgeRtcCallWithOptions(request: BridgeRtcCallRequest, runtime: $RuntimeOptions): BridgeRtcCallResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.callee)) {
    query['Callee'] = request.callee;
  }
  if (!$isNull(request.caller)) {
    query['Caller'] = request.caller;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.serviceProvider)) {
    query['ServiceProvider'] = request.serviceProvider;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!$isNull(request.timeoutSeconds)) {
    query['TimeoutSeconds'] = request.timeoutSeconds;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  if (!$isNull(request.videoEnabled)) {
    query['VideoEnabled'] = request.videoEnabled;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BridgeRtcCall',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request BridgeRtcCallRequest
 * @return BridgeRtcCallResponse
 */
async function bridgeRtcCall(request: BridgeRtcCallRequest): BridgeRtcCallResponse {
  var runtime = new $RuntimeOptions{};
  return bridgeRtcCallWithOptions(request, runtime);
}

model CancelAttendedTransferRequest {
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-6538214103685****'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model CancelAttendedTransferResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='CONSULTANT'),
          channelFlags?: string(name='ChannelFlags', example='MONITORING'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-653821410368****'),
          channelState?: string(name='ChannelState', example='ANSWERED'),
          destination?: string(name='Destination', example='1390501****'),
          index?: int32(name='Index', example='10'),
          jobId?: string(name='JobId', example='job-6538214103685****'),
          originator?: string(name='Originator', example='0830019****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          timestamp?: long(name='Timestamp', example='1609138903315'),
          userExtension?: string(name='UserExtension', example='8032****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    contextId?: long(name='ContextId', example='103656'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8032****'),
      heartbeat?: long(name='Heartbeat', example='1609136956378'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
      mobile?: string(name='Mobile', example='1324730****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1609136956378'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model CancelAttendedTransferResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelAttendedTransferResponseBody(name='body'),
}

/**
 * @param request CancelAttendedTransferRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelAttendedTransferResponse
 */
async function cancelAttendedTransferWithOptions(request: CancelAttendedTransferRequest, runtime: $RuntimeOptions): CancelAttendedTransferResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CancelAttendedTransfer',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CancelAttendedTransferRequest
 * @return CancelAttendedTransferResponse
 */
async function cancelAttendedTransfer(request: CancelAttendedTransferRequest): CancelAttendedTransferResponse {
  var runtime = new $RuntimeOptions{};
  return cancelAttendedTransferWithOptions(request, runtime);
}

model ChangeVisibilityRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='szpczf'),
  invisible?: boolean(name='Invisible', example='true'),
  userId?: string(name='UserId', example='sam@szpczf'),
}

model ChangeVisibilityResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    breakCode?: string(name='BreakCode'),
    deviceId?: string(name='DeviceId', example='Yealink SIP-T23G 44.84.203.6'),
    extension?: string(name='Extension', example='8001****'),
    instanceId?: string(name='InstanceId', example='szpczf'),
    jobId?: string(name='JobId', example='job-330557290544431104'),
    outboundScenario?: boolean(name='OutboundScenario', example='False'),
    signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
    userId?: string(name='UserId', example='sam@szpczf'),
    userState?: string(name='UserState', example='Ready'),
    workMode?: string(name='WorkMode', example='ON_SITE'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='Internal service issue. Detail:.'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='24BE19E8-BF7D-4992-A35E-15EBA874F2E5'),
}

model ChangeVisibilityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeVisibilityResponseBody(name='body'),
}

/**
 * @param request ChangeVisibilityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeVisibilityResponse
 */
async function changeVisibilityWithOptions(request: ChangeVisibilityRequest, runtime: $RuntimeOptions): ChangeVisibilityResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.invisible)) {
    query['Invisible'] = request.invisible;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ChangeVisibility',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ChangeVisibilityRequest
 * @return ChangeVisibilityResponse
 */
async function changeVisibility(request: ChangeVisibilityRequest): ChangeVisibilityResponse {
  var runtime = new $RuntimeOptions{};
  return changeVisibilityWithOptions(request, runtime);
}

model ChangeWorkModeRequest {
  deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  mobile?: string(name='Mobile', example='1382114****'),
  signedSkillGroupIdList?: string(name='SignedSkillGroupIdList', example='["online-1@ccc-test","online-2@ccc-test","online-3@ccc-test","skg-default@ccc-test"]'),
  userId?: string(name='UserId', example='agent@ccc-test'),
  workMode?: string(name='WorkMode', description='This parameter is required.', example='ON_SITE'),
}

model ChangeWorkModeResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    breakCode?: string(name='BreakCode', example='Warm-up'),
    deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
    extension?: string(name='Extension', example='8001****'),
    instanceId?: string(name='InstanceId', example='ccc-test'),
    jobId?: string(name='JobId'),
    outboundScenario?: boolean(name='OutboundScenario', example='false'),
    signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
    userId?: string(name='UserId', example='agent@ccc-test'),
    userState?: string(name='UserState', example='OFFLINE'),
    workMode?: string(name='WorkMode', example='ON_SITE'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='87731ED1-6224-48A5-99E3-6237FF9B1C00'),
}

model ChangeWorkModeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeWorkModeResponseBody(name='body'),
}

/**
 * @param request ChangeWorkModeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeWorkModeResponse
 */
async function changeWorkModeWithOptions(request: ChangeWorkModeRequest, runtime: $RuntimeOptions): ChangeWorkModeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.mobile)) {
    query['Mobile'] = request.mobile;
  }
  if (!$isNull(request.signedSkillGroupIdList)) {
    query['SignedSkillGroupIdList'] = request.signedSkillGroupIdList;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  if (!$isNull(request.workMode)) {
    query['WorkMode'] = request.workMode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ChangeWorkMode',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ChangeWorkModeRequest
 * @return ChangeWorkModeResponse
 */
async function changeWorkMode(request: ChangeWorkModeRequest): ChangeWorkModeResponse {
  var runtime = new $RuntimeOptions{};
  return changeWorkModeWithOptions(request, runtime);
}

model ClaimChatRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='chat-65382141036853491'),
  skillGroupId?: string(name='SkillGroupId', description='This parameter is required.', example='skillgroup@ccc-test'),
}

model ClaimChatResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    chatContexts?: [ 
      {
        accessChannelId?: string(name='AccessChannelId', example='226****-cbb6-****-8fea-1e71baf7bfa7'),
        accessChannelName?: string(name='AccessChannelName'),
        accessChannelType?: string(name='AccessChannelType', example='Web'),
        beingAssigned?: boolean(name='BeingAssigned', example='true'),
        callVariables?: string(name='CallVariables'),
        chatType?: string(name='ChatType', example='INBOUND'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        jobId?: string(name='JobId', example='chat-65382141036853491'),
      }
    ](name='ChatContexts'),
    contextId?: long(name='ContextId', example='123456789'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='CCC-169.254.165.2-browser125.0.0-bs48b41903450e6c8'),
      deviceState?: string(name='DeviceState', example='ONLINE'),
      extension?: string(name='Extension', example='8032****'),
      heartbeat?: long(name='Heartbeat', example='1609136956378'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='chat-65382141036853491'),
      mobile?: string(name='Mobile', example='18******102'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='false'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='userId@ccc-test'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='BC976D32-AC4C-4E0F-8AA9-F4BC6C4E2B3E'),
}

model ClaimChatResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ClaimChatResponseBody(name='body'),
}

/**
 * @param request ClaimChatRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ClaimChatResponse
 */
async function claimChatWithOptions(request: ClaimChatRequest, runtime: $RuntimeOptions): ClaimChatResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ClaimChat',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ClaimChatRequest
 * @return ClaimChatResponse
 */
async function claimChat(request: ClaimChatRequest): ClaimChatResponse {
  var runtime = new $RuntimeOptions{};
  return claimChatWithOptions(request, runtime);
}

model CoachCallRequest {
  coachedUserId?: string(name='CoachedUserId', description='This parameter is required.', example='coached-agent@ccc-test'),
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-65382141036853491'),
  timeoutSeconds?: int32(name='TimeoutSeconds', example='30'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model CoachCallResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='COACH'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='COACH'),
          channelFlags?: string(name='ChannelFlags', example='COACHING'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-653821410368****'),
          channelState?: string(name='ChannelState', example='ANSWERED'),
          destination?: string(name='Destination', example='1390501****'),
          index?: int32(name='Index', example='1'),
          jobId?: string(name='JobId', example='job-6538214103685****'),
          originator?: string(name='Originator', example='0830019****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
          timestamp?: long(name='Timestamp', example='1609138903315'),
          userExtension?: string(name='UserExtension', example='8032****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      deviceState?: string(name='DeviceState', example='UNREGISTERED'),
      extension?: string(name='Extension', example='8032****'),
      heartbeat?: long(name='Heartbeat', example='1609136956378'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
      mobile?: string(name='Mobile', example='1324730****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1609136956370'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model CoachCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CoachCallResponseBody(name='body'),
}

/**
 * @param request CoachCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CoachCallResponse
 */
async function coachCallWithOptions(request: CoachCallRequest, runtime: $RuntimeOptions): CoachCallResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.coachedUserId)) {
    query['CoachedUserId'] = request.coachedUserId;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.timeoutSeconds)) {
    query['TimeoutSeconds'] = request.timeoutSeconds;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CoachCall',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CoachCallRequest
 * @return CoachCallResponse
 */
async function coachCall(request: CoachCallRequest): CoachCallResponse {
  var runtime = new $RuntimeOptions{};
  return coachCallWithOptions(request, runtime);
}

model CommitContactFlowRequest {
  contactFlowId?: string(name='ContactFlowId', description='This parameter is required.', example='7d706489-d06d-4a92-8666-8c9dba2c5cb1'),
  definition?: string(name='Definition', description='This parameter is required.'),
  description?: string(name='Description', description='This parameter is required.', example='1'),
  draftId?: string(name='DraftId', description='This parameter is required.', example='b28f74ca-5846-4496-8bbd-34fb1750798c'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model CommitContactFlowResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='937617D5-01E9-5A39-B52D-15D5C143260C'),
}

model CommitContactFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CommitContactFlowResponseBody(name='body'),
}

/**
 * @param request CommitContactFlowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CommitContactFlowResponse
 */
async function commitContactFlowWithOptions(request: CommitContactFlowRequest, runtime: $RuntimeOptions): CommitContactFlowResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactFlowId)) {
    query['ContactFlowId'] = request.contactFlowId;
  }
  if (!$isNull(request.definition)) {
    query['Definition'] = request.definition;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.draftId)) {
    query['DraftId'] = request.draftId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CommitContactFlow',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CommitContactFlowRequest
 * @return CommitContactFlowResponse
 */
async function commitContactFlow(request: CommitContactFlowRequest): CommitContactFlowResponse {
  var runtime = new $RuntimeOptions{};
  return commitContactFlowWithOptions(request, runtime);
}

model CompleteAttendedTransferRequest {
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-6538214103685****'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model CompleteAttendedTransferResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelFlags?: string(name='ChannelFlags', example='MONITORING'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-653821410368****'),
          channelState?: string(name='ChannelState', example='ANSWERED'),
          destination?: string(name='Destination', example='1390501****'),
          index?: int32(name='Index', example='10'),
          jobId?: string(name='JobId', example='job-6538214103685****'),
          originator?: string(name='Originator', example='0830019****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
          timestamp?: long(name='Timestamp', example='1609138903315'),
          userExtension?: string(name='UserExtension', example='8032****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    contextId?: long(name='ContextId', example='103652'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8032****'),
      heartbeat?: long(name='Heartbeat', example='1609136956378'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-65382141036853491'),
      mobile?: string(name='Mobile', example='1324730****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1609136956378'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model CompleteAttendedTransferResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CompleteAttendedTransferResponseBody(name='body'),
}

/**
 * @param request CompleteAttendedTransferRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CompleteAttendedTransferResponse
 */
async function completeAttendedTransferWithOptions(request: CompleteAttendedTransferRequest, runtime: $RuntimeOptions): CompleteAttendedTransferResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CompleteAttendedTransfer',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CompleteAttendedTransferRequest
 * @return CompleteAttendedTransferResponse
 */
async function completeAttendedTransfer(request: CompleteAttendedTransferRequest): CompleteAttendedTransferResponse {
  var runtime = new $RuntimeOptions{};
  return completeAttendedTransferWithOptions(request, runtime);
}

model CreateAudioFileRequest {
  audioFileName?: string(name='AudioFileName', description='This parameter is required.', example='test-file.wav'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  name?: string(name='Name', description='This parameter is required.'),
  ossFileKey?: string(name='OssFileKey', description='This parameter is required.', example='ccc-test/test-file.wav'),
  usage?: string(name='Usage'),
}

model CreateAudioFileResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='2301b83f-1f9f-491e-9f97-2f832ed92f0b'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='94E29B9B-DBC6-5951-B3DD-C85C1BDF20ED'),
}

model CreateAudioFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAudioFileResponseBody(name='body'),
}

/**
 * @param request CreateAudioFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAudioFileResponse
 */
async function createAudioFileWithOptions(request: CreateAudioFileRequest, runtime: $RuntimeOptions): CreateAudioFileResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.audioFileName)) {
    query['AudioFileName'] = request.audioFileName;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.ossFileKey)) {
    query['OssFileKey'] = request.ossFileKey;
  }
  if (!$isNull(request.usage)) {
    query['Usage'] = request.usage;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateAudioFile',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateAudioFileRequest
 * @return CreateAudioFileResponse
 */
async function createAudioFile(request: CreateAudioFileRequest): CreateAudioFileResponse {
  var runtime = new $RuntimeOptions{};
  return createAudioFileWithOptions(request, runtime);
}

model CreateCallSummaryRequest {
  contactId?: string(name='ContactId', example='job-522327189435260928'),
  context?: string(name='Context'),
  customerId?: string(name='CustomerId', example='51e155ce-3747-*****-b402-13c69597b920'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model CreateCallSummaryResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='c58b9719-3bc3-441d-a4d3-fc0309ef7066'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='8707EB29-BAED-4302-B999-40BA61877437'),
}

model CreateCallSummaryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCallSummaryResponseBody(name='body'),
}

/**
 * @param request CreateCallSummaryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCallSummaryResponse
 */
async function createCallSummaryWithOptions(request: CreateCallSummaryRequest, runtime: $RuntimeOptions): CreateCallSummaryResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactId)) {
    query['ContactId'] = request.contactId;
  }
  if (!$isNull(request.context)) {
    query['Context'] = request.context;
  }
  if (!$isNull(request.customerId)) {
    query['CustomerId'] = request.customerId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateCallSummary',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateCallSummaryRequest
 * @return CreateCallSummaryResponse
 */
async function createCallSummary(request: CreateCallSummaryRequest): CreateCallSummaryResponse {
  var runtime = new $RuntimeOptions{};
  return createCallSummaryWithOptions(request, runtime);
}

model CreateCallTagsRequest {
  callTagNameList?: string(name='CallTagNameList', description='This parameter is required.', example='["TagA","TagB"]'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model CreateCallTagsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      item?: string(name='Item', example='TagC'),
      reason?: string(name='Reason', example='CALL_TAG_NAME_DUPLICATED'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model CreateCallTagsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCallTagsResponseBody(name='body'),
}

/**
 * @summary 批量创建号码标签
 *
 * @param request CreateCallTagsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCallTagsResponse
 */
async function createCallTagsWithOptions(request: CreateCallTagsRequest, runtime: $RuntimeOptions): CreateCallTagsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.callTagNameList)) {
    query['CallTagNameList'] = request.callTagNameList;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateCallTags',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 批量创建号码标签
 *
 * @param request CreateCallTagsRequest
 * @return CreateCallTagsResponse
 */
async function createCallTags(request: CreateCallTagsRequest): CreateCallTagsResponse {
  var runtime = new $RuntimeOptions{};
  return createCallTagsWithOptions(request, runtime);
}

model CreateCampaignRequest {
  callableTime?: string(name='CallableTime', description='This parameter is required.', example='[{"beginTime":"00:00:00","endTime":"23:00:00" }]'),
  caseFileKey?: string(name='CaseFileKey', example='ccc-test/namelist.csv'),
  caseList?: [ 
    {
      customVariables?: string(name='CustomVariables'),
      phoneNumber?: string(name='PhoneNumber', example='1888888888'),
      referenceId?: string(name='ReferenceId', example='01'),
    }
  ](name='CaseList'),
  contactFlowId?: string(name='ContactFlowId', description='This parameter is required.', example='c1f2bc75-422e-43c7-9c9d9d95633a'),
  endTime?: string(name='EndTime', description='This parameter is required.', example='1634313600000'),
  executingUntilTimeout?: boolean(name='ExecutingUntilTimeout'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  maxAttemptCount?: long(name='MaxAttemptCount', description='This parameter is required.', example='1'),
  minAttemptInterval?: long(name='MinAttemptInterval', description='This parameter is required.', example='1'),
  name?: string(name='Name', description='This parameter is required.', example='test-campaign'),
  queueId?: string(name='QueueId', description='This parameter is required.', example='skillgroup@ccc-test'),
  simulation?: boolean(name='Simulation'),
  simulationParameters?: string(name='SimulationParameters'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='1634140800000'),
  strategyParameters?: string(name='StrategyParameters', description='This parameter is required.', example='{"ratio":1}'),
  strategyType?: string(name='StrategyType', description='This parameter is required.', example='PACING'),
}

model CreateCampaignShrinkRequest {
  callableTime?: string(name='CallableTime', description='This parameter is required.', example='[{"beginTime":"00:00:00","endTime":"23:00:00" }]'),
  caseFileKey?: string(name='CaseFileKey', example='ccc-test/namelist.csv'),
  caseListShrink?: string(name='CaseList'),
  contactFlowId?: string(name='ContactFlowId', description='This parameter is required.', example='c1f2bc75-422e-43c7-9c9d9d95633a'),
  endTime?: string(name='EndTime', description='This parameter is required.', example='1634313600000'),
  executingUntilTimeout?: boolean(name='ExecutingUntilTimeout'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  maxAttemptCount?: long(name='MaxAttemptCount', description='This parameter is required.', example='1'),
  minAttemptInterval?: long(name='MinAttemptInterval', description='This parameter is required.', example='1'),
  name?: string(name='Name', description='This parameter is required.', example='test-campaign'),
  queueId?: string(name='QueueId', description='This parameter is required.', example='skillgroup@ccc-test'),
  simulation?: boolean(name='Simulation'),
  simulationParameters?: string(name='SimulationParameters'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='1634140800000'),
  strategyParameters?: string(name='StrategyParameters', description='This parameter is required.', example='{"ratio":1}'),
  strategyType?: string(name='StrategyType', description='This parameter is required.', example='PACING'),
}

model CreateCampaignResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='c58b9719-3bc3-441d-a4d3-fc0309ef7066'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='7CC6523B-0E51-1B62-8DA5-6A9831CAE315'),
}

model CreateCampaignResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCampaignResponseBody(name='body'),
}

/**
 * @summary 创建预测式外呼活动
 *
 * @param tmpReq CreateCampaignRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCampaignResponse
 */
async function createCampaignWithOptions(tmpReq: CreateCampaignRequest, runtime: $RuntimeOptions): CreateCampaignResponse {
  tmpReq.validate();
  var request = new CreateCampaignShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.caseList)) {
    request.caseListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.caseList, 'CaseList', 'json');
  }
  var query = {};
  if (!$isNull(request.callableTime)) {
    query['CallableTime'] = request.callableTime;
  }
  if (!$isNull(request.caseFileKey)) {
    query['CaseFileKey'] = request.caseFileKey;
  }
  if (!$isNull(request.caseListShrink)) {
    query['CaseList'] = request.caseListShrink;
  }
  if (!$isNull(request.contactFlowId)) {
    query['ContactFlowId'] = request.contactFlowId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.executingUntilTimeout)) {
    query['ExecutingUntilTimeout'] = request.executingUntilTimeout;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.maxAttemptCount)) {
    query['MaxAttemptCount'] = request.maxAttemptCount;
  }
  if (!$isNull(request.minAttemptInterval)) {
    query['MinAttemptInterval'] = request.minAttemptInterval;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.queueId)) {
    query['QueueId'] = request.queueId;
  }
  if (!$isNull(request.simulation)) {
    query['Simulation'] = request.simulation;
  }
  if (!$isNull(request.simulationParameters)) {
    query['SimulationParameters'] = request.simulationParameters;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.strategyParameters)) {
    query['StrategyParameters'] = request.strategyParameters;
  }
  if (!$isNull(request.strategyType)) {
    query['StrategyType'] = request.strategyType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateCampaign',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建预测式外呼活动
 *
 * @param request CreateCampaignRequest
 * @return CreateCampaignResponse
 */
async function createCampaign(request: CreateCampaignRequest): CreateCampaignResponse {
  var runtime = new $RuntimeOptions{};
  return createCampaignWithOptions(request, runtime);
}

model CreateChatMediaUrlRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='9cfad875-6260-4a53-ab6e-b13e3fb31f7d'),
  mimeType?: string(name='MimeType', description='media id

This parameter is required.', example='jpg'),
  requestId?: string(name='RequestId', example='9F766284-F103-4298-8EC5-19F9F9BE5522'),
}

model CreateChatMediaUrlResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    mediaId?: string(name='MediaId', example='$iAHNCNQCo21wMwMGBAAFAAbaACOEAaQhIH6TAqogDGyb-qD2Hbj0A88AAAGRLKYVnwTOACwwYwcACM8AAAGRLRPynQ'),
    url?: string(name='Url', example='https://ccc-v2-online.oss-cn-shanghai.aliyuncs.com/ccc-test/namelist.csv?Expires=1642067227&OSSAccessKeyId=****&Signature=****'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='03C67DAD-EB26-41D8-949D-9B0C470FB716'),
}

model CreateChatMediaUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateChatMediaUrlResponseBody(name='body'),
}

/**
 * @param request CreateChatMediaUrlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateChatMediaUrlResponse
 */
async function createChatMediaUrlWithOptions(request: CreateChatMediaUrlRequest, runtime: $RuntimeOptions): CreateChatMediaUrlResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.mimeType)) {
    body['MimeType'] = request.mimeType;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateChatMediaUrl',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateChatMediaUrlRequest
 * @return CreateChatMediaUrlResponse
 */
async function createChatMediaUrl(request: CreateChatMediaUrlRequest): CreateChatMediaUrlResponse {
  var runtime = new $RuntimeOptions{};
  return createChatMediaUrlWithOptions(request, runtime);
}

model CreateContactFlowRequest {
  definition?: string(name='Definition', description='This parameter is required.'),
  description?: string(name='Description', description='This parameter is required.', example='1.0'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  name?: string(name='Name', description='This parameter is required.'),
  type?: string(name='Type', description='This parameter is required.', example='MAIN_FLOW'),
}

model CreateContactFlowResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='78128960-bb00-4ddc-8e82-923a8c5bd22d'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='2778FA12-EDD6-42AA-9B15-AF855072E5E5'),
}

model CreateContactFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateContactFlowResponseBody(name='body'),
}

/**
 * @param request CreateContactFlowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateContactFlowResponse
 */
async function createContactFlowWithOptions(request: CreateContactFlowRequest, runtime: $RuntimeOptions): CreateContactFlowResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.definition)) {
    query['Definition'] = request.definition;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateContactFlow',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateContactFlowRequest
 * @return CreateContactFlowResponse
 */
async function createContactFlow(request: CreateContactFlowRequest): CreateContactFlowResponse {
  var runtime = new $RuntimeOptions{};
  return createContactFlowWithOptions(request, runtime);
}

model CreateCustomCallTaggingRequest {
  customNumberList?: string(name='CustomNumberList', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model CreateCustomCallTaggingResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      item?: string(name='Item', example='1312121****'),
      reason?: string(name='Reason', example='CUSTOM_NUMBER_DUPLICATED'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model CreateCustomCallTaggingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCustomCallTaggingResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI CreateCustomCallTagging is deprecated, please use CCC::2020-07-01::CreateCustomCallTaggings instead.
 *
 * @summary 创建呼入控制号码
 *
 * @param request CreateCustomCallTaggingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCustomCallTaggingResponse
 */
// Deprecated
async function createCustomCallTaggingWithOptions(request: CreateCustomCallTaggingRequest, runtime: $RuntimeOptions): CreateCustomCallTaggingResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.customNumberList)) {
    query['CustomNumberList'] = request.customNumberList;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateCustomCallTagging',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @deprecated OpenAPI CreateCustomCallTagging is deprecated, please use CCC::2020-07-01::CreateCustomCallTaggings instead.
 *
 * @summary 创建呼入控制号码
 *
 * @param request CreateCustomCallTaggingRequest
 * @return CreateCustomCallTaggingResponse
 */
// Deprecated
async function createCustomCallTagging(request: CreateCustomCallTaggingRequest): CreateCustomCallTaggingResponse {
  var runtime = new $RuntimeOptions{};
  return createCustomCallTaggingWithOptions(request, runtime);
}

model CreateInstanceRequest {
  adminRamIdList?: string(name='AdminRamIdList', description='This parameter is required.', example='["24861380681070****","105980354482****"]'),
  description?: string(name='Description'),
  domainName?: string(name='DomainName', description='This parameter is required.', example='ccc-test'),
  name?: string(name='Name', description='This parameter is required.'),
  numberList?: string(name='NumberList', description='This parameter is required.', example='["0830011xxxx", "0830312xxxx"]'),
}

model CreateInstanceResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='75c1346c-1dc2-4ed8-973f-edf8b1e5fe77'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='2778FA12-EDD6-42AA-9B15-AF855072E5E5'),
}

model CreateInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateInstanceResponseBody(name='body'),
}

/**
 * @param request CreateInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateInstanceResponse
 */
async function createInstanceWithOptions(request: CreateInstanceRequest, runtime: $RuntimeOptions): CreateInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.adminRamIdList)) {
    query['AdminRamIdList'] = request.adminRamIdList;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.numberList)) {
    query['NumberList'] = request.numberList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateInstance',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateInstanceRequest
 * @return CreateInstanceResponse
 */
async function createInstance(request: CreateInstanceRequest): CreateInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return createInstanceWithOptions(request, runtime);
}

model CreateSchemaRequest {
  description?: string(name='Description', example='-'),
  id?: string(name='Id', description='schema id', example='profile'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='b0eb2742-f37e-4c67-82d4-25c651c1c450'),
  properties?: [ 
    {
      array?: boolean(name='Array', example='false'),
      attributes?: string(name='Attributes', example='{\\\\"Clusters\\\\": {\\\\"Description\\\\": \\\\"The list of clusters.\\\\"}, \\\\"ClusterIds\\\\": {\\\\"Description\\\\": \\\\"The list of cluster IDs.\\\\"}}'),
      dataType?: string(name='DataType', description='This parameter is required.', example='string'),
      description?: string(name='Description', example='-'),
      disabled?: boolean(name='Disabled', example='false'),
      displayName?: string(name='DisplayName'),
      displayOrder?: int32(name='DisplayOrder', example='2'),
      editorType?: string(name='EditorType', example='textbox'),
      maxLength?: int32(name='MaxLength', example='100'),
      maximum?: double(name='Maximum', example='1'),
      minLength?: int32(name='MinLength', example='1'),
      minimum?: double(name='Minimum', example='1'),
      name?: string(name='Name', description='This parameter is required.', example='name'),
      pattern?: string(name='Pattern', example='*'),
      patternErrorMessage?: string(name='PatternErrorMessage'),
      readOnly?: boolean(name='ReadOnly', example='true'),
      required?: boolean(name='Required', example='false'),
    }
  ](name='Properties'),
  requestId?: string(name='RequestId', example='7BEEA660-A45A-45E3-98CC-AFC65E715C23'),
}

model CreateSchemaShrinkRequest {
  description?: string(name='Description', example='-'),
  id?: string(name='Id', description='schema id', example='profile'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='b0eb2742-f37e-4c67-82d4-25c651c1c450'),
  propertiesShrink?: string(name='Properties'),
  requestId?: string(name='RequestId', example='7BEEA660-A45A-45E3-98CC-AFC65E715C23'),
}

model CreateSchemaResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='1ca2b084-6f0a-454b-9851-29768a9a5832'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='9F766284-F103-4298-8EC5-19F9F9BE5522'),
}

model CreateSchemaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSchemaResponseBody(name='body'),
}

/**
 * @param tmpReq CreateSchemaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSchemaResponse
 */
async function createSchemaWithOptions(tmpReq: CreateSchemaRequest, runtime: $RuntimeOptions): CreateSchemaResponse {
  tmpReq.validate();
  var request = new CreateSchemaShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.properties)) {
    request.propertiesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.properties, 'Properties', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.description)) {
    body['Description'] = request.description;
  }
  if (!$isNull(request.id)) {
    body['Id'] = request.id;
  }
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.propertiesShrink)) {
    body['Properties'] = request.propertiesShrink;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateSchema',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateSchemaRequest
 * @return CreateSchemaResponse
 */
async function createSchema(request: CreateSchemaRequest): CreateSchemaResponse {
  var runtime = new $RuntimeOptions{};
  return createSchemaWithOptions(request, runtime);
}

model CreateSkillGroupRequest {
  description?: string(name='Description'),
  displayName?: string(name='DisplayName', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  mediaType?: string(name='MediaType'),
  name?: string(name='Name', description='This parameter is required.', example='skillgroup'),
}

model CreateSkillGroupResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    description?: string(name='Description'),
    instanceId?: string(name='InstanceId', example='ccc-test'),
    mediaType?: string(name='MediaType'),
    name?: string(name='Name', example='skillgroup'),
    skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model CreateSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSkillGroupResponseBody(name='body'),
}

/**
 * @param request CreateSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSkillGroupResponse
 */
async function createSkillGroupWithOptions(request: CreateSkillGroupRequest, runtime: $RuntimeOptions): CreateSkillGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.displayName)) {
    query['DisplayName'] = request.displayName;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateSkillGroup',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateSkillGroupRequest
 * @return CreateSkillGroupResponse
 */
async function createSkillGroup(request: CreateSkillGroupRequest): CreateSkillGroupResponse {
  var runtime = new $RuntimeOptions{};
  return createSkillGroupWithOptions(request, runtime);
}

model CreateTicketRequest {
  contactId?: string(name='ContactId', example='job-38860977107324****'),
  context?: string(name='Context'),
  customerId?: string(name='CustomerId', example='51e155ce-3747-4f21-b402-13c69597b920'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  source?: string(name='Source', example='CHAT'),
  templateId?: string(name='TemplateId', example='e9e4c76c-948d-4a6e-9ce2-9da0f5967a73'),
  title?: string(name='Title'),
}

model CreateTicketResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='3d26b90a-c5d2-4b09-8219-60cda1******'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='A450574A-337F-43E2-BC59-9C6594C994C6'),
}

model CreateTicketResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTicketResponseBody(name='body'),
}

/**
 * @param request CreateTicketRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTicketResponse
 */
async function createTicketWithOptions(request: CreateTicketRequest, runtime: $RuntimeOptions): CreateTicketResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactId)) {
    query['ContactId'] = request.contactId;
  }
  if (!$isNull(request.context)) {
    query['Context'] = request.context;
  }
  if (!$isNull(request.customerId)) {
    query['CustomerId'] = request.customerId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.source)) {
    query['Source'] = request.source;
  }
  if (!$isNull(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  if (!$isNull(request.title)) {
    query['Title'] = request.title;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateTicket',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateTicketRequest
 * @return CreateTicketResponse
 */
async function createTicket(request: CreateTicketRequest): CreateTicketResponse {
  var runtime = new $RuntimeOptions{};
  return createTicketWithOptions(request, runtime);
}

model CreateUserRequest {
  avatarUrl?: string(name='AvatarUrl'),
  displayId?: string(name='DisplayId', example='1001'),
  displayName?: string(name='DisplayName', description='This parameter is required.'),
  email?: string(name='Email', description='This parameter is required.', example='username@example.com'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  loginName?: string(name='LoginName', description='This parameter is required.', example='agent'),
  mobile?: string(name='Mobile', example='1382114****'),
  nickname?: string(name='Nickname'),
  resetPassword?: boolean(name='ResetPassword', example='false'),
  roleId?: string(name='RoleId', description='This parameter is required.', example='Agent@ccc-test'),
  skillLevelList?: string(name='SkillLevelList', example='[{"skillGroupId":"skillgroup1@ccc-test","skillLevel":1},{"skillGroupId":"skillgroup2@ccc-test","skillLevel":10}]'),
  workMode?: string(name='WorkMode', example='ON_SITE'),
}

model CreateUserResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    avatarUrl?: string(name='AvatarUrl'),
    displayName?: string(name='DisplayName'),
    email?: string(name='Email', example='username@example.com'),
    extension?: string(name='Extension', example='8032****'),
    loginName?: string(name='LoginName', example='agent'),
    mobile?: string(name='Mobile', example='1382114****'),
    nickname?: string(name='Nickname'),
    userId?: string(name='UserId', example='agent@ccc-test'),
    workMode?: string(name='WorkMode', example='ON_SITE'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model CreateUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateUserResponseBody(name='body'),
}

/**
 * @param request CreateUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateUserResponse
 */
async function createUserWithOptions(request: CreateUserRequest, runtime: $RuntimeOptions): CreateUserResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.avatarUrl)) {
    query['AvatarUrl'] = request.avatarUrl;
  }
  if (!$isNull(request.displayId)) {
    query['DisplayId'] = request.displayId;
  }
  if (!$isNull(request.displayName)) {
    query['DisplayName'] = request.displayName;
  }
  if (!$isNull(request.email)) {
    query['Email'] = request.email;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.loginName)) {
    query['LoginName'] = request.loginName;
  }
  if (!$isNull(request.mobile)) {
    query['Mobile'] = request.mobile;
  }
  if (!$isNull(request.nickname)) {
    query['Nickname'] = request.nickname;
  }
  if (!$isNull(request.resetPassword)) {
    query['ResetPassword'] = request.resetPassword;
  }
  if (!$isNull(request.roleId)) {
    query['RoleId'] = request.roleId;
  }
  if (!$isNull(request.skillLevelList)) {
    query['SkillLevelList'] = request.skillLevelList;
  }
  if (!$isNull(request.workMode)) {
    query['WorkMode'] = request.workMode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateUser',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateUserRequest
 * @return CreateUserResponse
 */
async function createUser(request: CreateUserRequest): CreateUserResponse {
  var runtime = new $RuntimeOptions{};
  return createUserWithOptions(request, runtime);
}

model DeleteAudioFileRequest {
  audioResourceId?: string(name='AudioResourceId', description='This parameter is required.', example='d5cd7a94-3b6a-47d2-b7fd-0b1cd839bf77'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model DeleteAudioFileResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='FB77821C-912F-57FF-8834-6336A6479093'),
}

model DeleteAudioFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAudioFileResponseBody(name='body'),
}

/**
 * @param request DeleteAudioFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAudioFileResponse
 */
async function deleteAudioFileWithOptions(request: DeleteAudioFileRequest, runtime: $RuntimeOptions): DeleteAudioFileResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.audioResourceId)) {
    query['AudioResourceId'] = request.audioResourceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteAudioFile',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteAudioFileRequest
 * @return DeleteAudioFileResponse
 */
async function deleteAudioFile(request: DeleteAudioFileRequest): DeleteAudioFileResponse {
  var runtime = new $RuntimeOptions{};
  return deleteAudioFileWithOptions(request, runtime);
}

model DeleteCallTagRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  tagName?: string(name='TagName', description='This parameter is required.', example='TagA'),
}

model DeleteCallTagResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model DeleteCallTagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCallTagResponseBody(name='body'),
}

/**
 * @summary 删除号码标签
 *
 * @param request DeleteCallTagRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCallTagResponse
 */
async function deleteCallTagWithOptions(request: DeleteCallTagRequest, runtime: $RuntimeOptions): DeleteCallTagResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.tagName)) {
    query['TagName'] = request.tagName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteCallTag',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除号码标签
 *
 * @param request DeleteCallTagRequest
 * @return DeleteCallTagResponse
 */
async function deleteCallTag(request: DeleteCallTagRequest): DeleteCallTagResponse {
  var runtime = new $RuntimeOptions{};
  return deleteCallTagWithOptions(request, runtime);
}

model DeleteContactFlowRequest {
  contactFlowId?: string(name='ContactFlowId', description='This parameter is required.', example='0f87c997-b0c1-41d4-9e9e-1b791de6ad1f'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model DeleteContactFlowResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='07511949-6DC4-5D0B-8FA8-FF8FA29B4217'),
}

model DeleteContactFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteContactFlowResponseBody(name='body'),
}

/**
 * @param request DeleteContactFlowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteContactFlowResponse
 */
async function deleteContactFlowWithOptions(request: DeleteContactFlowRequest, runtime: $RuntimeOptions): DeleteContactFlowResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactFlowId)) {
    query['ContactFlowId'] = request.contactFlowId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteContactFlow',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteContactFlowRequest
 * @return DeleteContactFlowResponse
 */
async function deleteContactFlow(request: DeleteContactFlowRequest): DeleteContactFlowResponse {
  var runtime = new $RuntimeOptions{};
  return deleteContactFlowWithOptions(request, runtime);
}

model DeleteCustomCallTaggingRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  number?: string(name='Number', description='This parameter is required.', example='1312121****'),
}

model DeleteCustomCallTaggingResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model DeleteCustomCallTaggingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCustomCallTaggingResponseBody(name='body'),
}

/**
 * @summary 删除呼入控制号码
 *
 * @param request DeleteCustomCallTaggingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCustomCallTaggingResponse
 */
async function deleteCustomCallTaggingWithOptions(request: DeleteCustomCallTaggingRequest, runtime: $RuntimeOptions): DeleteCustomCallTaggingResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.number)) {
    query['Number'] = request.number;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteCustomCallTagging',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除呼入控制号码
 *
 * @param request DeleteCustomCallTaggingRequest
 * @return DeleteCustomCallTaggingResponse
 */
async function deleteCustomCallTagging(request: DeleteCustomCallTaggingRequest): DeleteCustomCallTaggingResponse {
  var runtime = new $RuntimeOptions{};
  return deleteCustomCallTaggingWithOptions(request, runtime);
}

model DeleteDocumentRequest {
  documentId?: string(name='DocumentId', description='This parameter is required.', example='xxx'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='d278629c-c687-4aa3-b044-4fe9b012****'),
  requestId?: string(name='RequestId', example='DE803553-8AA9-4B9D-9E4E-A82BC69EDCEE'),
  schemaId?: string(name='SchemaId', description='schema id

This parameter is required.', example='profile'),
}

model DeleteDocumentResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='8707EB29-BAED-4302-B999-40BA61877437'),
}

model DeleteDocumentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDocumentResponseBody(name='body'),
}

/**
 * @param request DeleteDocumentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDocumentResponse
 */
async function deleteDocumentWithOptions(request: DeleteDocumentRequest, runtime: $RuntimeOptions): DeleteDocumentResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.documentId)) {
    body['DocumentId'] = request.documentId;
  }
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  if (!$isNull(request.schemaId)) {
    body['SchemaId'] = request.schemaId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteDocument',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteDocumentRequest
 * @return DeleteDocumentResponse
 */
async function deleteDocument(request: DeleteDocumentRequest): DeleteDocumentResponse {
  var runtime = new $RuntimeOptions{};
  return deleteDocumentWithOptions(request, runtime);
}

model DeleteDocumentsRequest {
  documentIds?: [ string ](name='DocumentIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='9cfad875-6260-4a53-ab6e-b13e3fb31f7d'),
  requestId?: string(name='RequestId', example='0630E5DF-CEB0-445B-8626-D5C7481181C3'),
  schemaId?: string(name='SchemaId', description='schema id

This parameter is required.', example='profile'),
}

model DeleteDocumentsShrinkRequest {
  documentIdsShrink?: string(name='DocumentIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='9cfad875-6260-4a53-ab6e-b13e3fb31f7d'),
  requestId?: string(name='RequestId', example='0630E5DF-CEB0-445B-8626-D5C7481181C3'),
  schemaId?: string(name='SchemaId', description='schema id

This parameter is required.', example='profile'),
}

model DeleteDocumentsResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='A450574A-337F-43E2-BC59-9C6594C994C6'),
}

model DeleteDocumentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDocumentsResponseBody(name='body'),
}

/**
 * @param tmpReq DeleteDocumentsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDocumentsResponse
 */
async function deleteDocumentsWithOptions(tmpReq: DeleteDocumentsRequest, runtime: $RuntimeOptions): DeleteDocumentsResponse {
  tmpReq.validate();
  var request = new DeleteDocumentsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.documentIds)) {
    request.documentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.documentIds, 'DocumentIds', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.documentIdsShrink)) {
    body['DocumentIds'] = request.documentIdsShrink;
  }
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  if (!$isNull(request.schemaId)) {
    body['SchemaId'] = request.schemaId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteDocuments',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteDocumentsRequest
 * @return DeleteDocumentsResponse
 */
async function deleteDocuments(request: DeleteDocumentsRequest): DeleteDocumentsResponse {
  var runtime = new $RuntimeOptions{};
  return deleteDocumentsWithOptions(request, runtime);
}

model DeleteInstanceRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model DeleteInstanceResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='b7feb007-994a-497f-8934-2f0c6f89867c'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model DeleteInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteInstanceResponseBody(name='body'),
}

/**
 * @param request DeleteInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteInstanceResponse
 */
async function deleteInstanceWithOptions(request: DeleteInstanceRequest, runtime: $RuntimeOptions): DeleteInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteInstance',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteInstanceRequest
 * @return DeleteInstanceResponse
 */
async function deleteInstance(request: DeleteInstanceRequest): DeleteInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return deleteInstanceWithOptions(request, runtime);
}

model DeleteSchemaRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='9cfad875-6260-4a53-ab6e-b13e3fb31f7d'),
  requestId?: string(name='RequestId', example='0630E5DF-CEB0-445B-8626-D5C7481181C3'),
  schemaId?: string(name='SchemaId', description='schema id

This parameter is required.', example='profile'),
}

model DeleteSchemaResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='678F7002-CA01-4ABF-A112-585AFBDF3A3B'),
}

model DeleteSchemaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSchemaResponseBody(name='body'),
}

/**
 * @param request DeleteSchemaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSchemaResponse
 */
async function deleteSchemaWithOptions(request: DeleteSchemaRequest, runtime: $RuntimeOptions): DeleteSchemaResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  if (!$isNull(request.schemaId)) {
    body['SchemaId'] = request.schemaId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteSchema',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteSchemaRequest
 * @return DeleteSchemaResponse
 */
async function deleteSchema(request: DeleteSchemaRequest): DeleteSchemaResponse {
  var runtime = new $RuntimeOptions{};
  return deleteSchemaWithOptions(request, runtime);
}

model DeleteSchemaPropertyRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='9cfad875-6260-4a53-ab6e-b13e3fb31f7d'),
  propertyName?: string(name='PropertyName', description='This parameter is required.', example='name'),
  requestId?: string(name='RequestId', example='7BEEA660-A45A-45E3-98CC-AFC65E715C23'),
  schemaId?: string(name='SchemaId', description='schema id

This parameter is required.', example='profile'),
}

model DeleteSchemaPropertyResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='User 244715989906081477 does not exist in instance worldfirst01.'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='7BEEA660-A45A-45E3-98CC-AFC65E715C23'),
}

model DeleteSchemaPropertyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSchemaPropertyResponseBody(name='body'),
}

/**
 * @param request DeleteSchemaPropertyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSchemaPropertyResponse
 */
async function deleteSchemaPropertyWithOptions(request: DeleteSchemaPropertyRequest, runtime: $RuntimeOptions): DeleteSchemaPropertyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.propertyName)) {
    body['PropertyName'] = request.propertyName;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  if (!$isNull(request.schemaId)) {
    body['SchemaId'] = request.schemaId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteSchemaProperty',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteSchemaPropertyRequest
 * @return DeleteSchemaPropertyResponse
 */
async function deleteSchemaProperty(request: DeleteSchemaPropertyRequest): DeleteSchemaPropertyResponse {
  var runtime = new $RuntimeOptions{};
  return deleteSchemaPropertyWithOptions(request, runtime);
}

model DeleteSkillGroupRequest {
  force?: boolean(name='Force', example='true'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  skillGroupId?: string(name='SkillGroupId', description='This parameter is required.', example='skillgroup@ccc-test'),
}

model DeleteSkillGroupResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model DeleteSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSkillGroupResponseBody(name='body'),
}

/**
 * @param request DeleteSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSkillGroupResponse
 */
async function deleteSkillGroupWithOptions(request: DeleteSkillGroupRequest, runtime: $RuntimeOptions): DeleteSkillGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.force)) {
    query['Force'] = request.force;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteSkillGroup',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteSkillGroupRequest
 * @return DeleteSkillGroupResponse
 */
async function deleteSkillGroup(request: DeleteSkillGroupRequest): DeleteSkillGroupResponse {
  var runtime = new $RuntimeOptions{};
  return deleteSkillGroupWithOptions(request, runtime);
}

model DeleteTicketRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  ticketId?: string(name='TicketId', example='3d26b90a-c5d2-4b09-8219-********'),
}

model DeleteTicketResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: any(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='2263B273-AC1B-44EB-BA98-87F2322C6780'),
}

model DeleteTicketResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTicketResponseBody(name='body'),
}

/**
 * @param request DeleteTicketRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteTicketResponse
 */
async function deleteTicketWithOptions(request: DeleteTicketRequest, runtime: $RuntimeOptions): DeleteTicketResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ticketId)) {
    query['TicketId'] = request.ticketId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteTicket',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteTicketRequest
 * @return DeleteTicketResponse
 */
async function deleteTicket(request: DeleteTicketRequest): DeleteTicketResponse {
  var runtime = new $RuntimeOptions{};
  return deleteTicketWithOptions(request, runtime);
}

model DeleteTicketTemplateRequest {
  instanceId?: string(name='InstanceId', example='ef1e71e9-ae9d-487c-96ad-9181d85cf802'),
  templateId?: string(name='TemplateId', example='**43c2671b-8939-4223-***-6bd187905cc8_1717664210492'),
}

model DeleteTicketTemplateResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: any(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='01B12EE4-6AF2-4730-8B78-EC15F4E5C025'),
}

model DeleteTicketTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTicketTemplateResponseBody(name='body'),
}

/**
 * @param request DeleteTicketTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteTicketTemplateResponse
 */
async function deleteTicketTemplateWithOptions(request: DeleteTicketTemplateRequest, runtime: $RuntimeOptions): DeleteTicketTemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteTicketTemplate',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteTicketTemplateRequest
 * @return DeleteTicketTemplateResponse
 */
async function deleteTicketTemplate(request: DeleteTicketTemplateRequest): DeleteTicketTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return deleteTicketTemplateWithOptions(request, runtime);
}

model DisableSchemaPropertyRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ef1e71e9-ae9d-487c-96ad-9181d85cf802'),
  propertyName?: string(name='PropertyName', description='This parameter is required.', example='name'),
  requestId?: string(name='RequestId', example='2263B273-AC1B-44EB-BA98-87F2322C6780'),
  schemaId?: string(name='SchemaId', description='schema id

This parameter is required.', example='profile'),
}

model DisableSchemaPropertyResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='User 244715989906081477 does not exist in instance worldfirst01.'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='9FBA26B0-462B-4D77-B78F-AF35560DBC71'),
}

model DisableSchemaPropertyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableSchemaPropertyResponseBody(name='body'),
}

/**
 * @param request DisableSchemaPropertyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableSchemaPropertyResponse
 */
async function disableSchemaPropertyWithOptions(request: DisableSchemaPropertyRequest, runtime: $RuntimeOptions): DisableSchemaPropertyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.propertyName)) {
    body['PropertyName'] = request.propertyName;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  if (!$isNull(request.schemaId)) {
    body['SchemaId'] = request.schemaId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DisableSchemaProperty',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DisableSchemaPropertyRequest
 * @return DisableSchemaPropertyResponse
 */
async function disableSchemaProperty(request: DisableSchemaPropertyRequest): DisableSchemaPropertyResponse {
  var runtime = new $RuntimeOptions{};
  return disableSchemaPropertyWithOptions(request, runtime);
}

model DisableTicketTemplateRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  templateId?: string(name='TemplateId', example='43c2671b-8939-4223-86d0-6bd187905cc8_1717664210492'),
}

model DisableTicketTemplateResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: any(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='943D8EF3-3321-471F-A104-51C96FCA94D6'),
}

model DisableTicketTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableTicketTemplateResponseBody(name='body'),
}

/**
 * @param request DisableTicketTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableTicketTemplateResponse
 */
async function disableTicketTemplateWithOptions(request: DisableTicketTemplateRequest, runtime: $RuntimeOptions): DisableTicketTemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DisableTicketTemplate',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DisableTicketTemplateRequest
 * @return DisableTicketTemplateResponse
 */
async function disableTicketTemplate(request: DisableTicketTemplateRequest): DisableTicketTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return disableTicketTemplateWithOptions(request, runtime);
}

model DiscardEditingContactFlowRequest {
  contactFlowId?: string(name='ContactFlowId', description='This parameter is required.', example='3ff4e021-fd63-4572-ad8c-10ed69972965'),
  draftId?: string(name='DraftId', description='This parameter is required.', example='0aa493d6-58eb-4290-9ba2-e1c2c615b46b'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model DiscardEditingContactFlowResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='CB72B537-B531-598F-9617-A636FB8040C0'),
}

model DiscardEditingContactFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DiscardEditingContactFlowResponseBody(name='body'),
}

/**
 * @param request DiscardEditingContactFlowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DiscardEditingContactFlowResponse
 */
async function discardEditingContactFlowWithOptions(request: DiscardEditingContactFlowRequest, runtime: $RuntimeOptions): DiscardEditingContactFlowResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactFlowId)) {
    query['ContactFlowId'] = request.contactFlowId;
  }
  if (!$isNull(request.draftId)) {
    query['DraftId'] = request.draftId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DiscardEditingContactFlow',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DiscardEditingContactFlowRequest
 * @return DiscardEditingContactFlowResponse
 */
async function discardEditingContactFlow(request: DiscardEditingContactFlowRequest): DiscardEditingContactFlowResponse {
  var runtime = new $RuntimeOptions{};
  return discardEditingContactFlowWithOptions(request, runtime);
}

model EnableSchemaPropertyRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='9cfad875-6260-4a53-ab6e-b13e3fb31f7d'),
  propertyName?: string(name='PropertyName', description='This parameter is required.', example='name'),
  requestId?: string(name='RequestId', example='03C67DAD-EB26-41D8-949D-9B0C470FB716'),
  schemaId?: string(name='SchemaId', description='schema id

This parameter is required.', example='profile'),
}

model EnableSchemaPropertyResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='The operation is not allowed. User state (READY) does not meet expectations (OFFLINE).'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='2778FA12-EDD6-42AA-9B15-AF855072E5E5'),
}

model EnableSchemaPropertyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableSchemaPropertyResponseBody(name='body'),
}

/**
 * @param request EnableSchemaPropertyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableSchemaPropertyResponse
 */
async function enableSchemaPropertyWithOptions(request: EnableSchemaPropertyRequest, runtime: $RuntimeOptions): EnableSchemaPropertyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.propertyName)) {
    body['PropertyName'] = request.propertyName;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  if (!$isNull(request.schemaId)) {
    body['SchemaId'] = request.schemaId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'EnableSchemaProperty',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request EnableSchemaPropertyRequest
 * @return EnableSchemaPropertyResponse
 */
async function enableSchemaProperty(request: EnableSchemaPropertyRequest): EnableSchemaPropertyResponse {
  var runtime = new $RuntimeOptions{};
  return enableSchemaPropertyWithOptions(request, runtime);
}

model EnableTicketTemplateRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  templateId?: string(name='TemplateId', example='43c2671b-8939-4223-86d0-6bd187905cc8_1717664210492'),
}

model EnableTicketTemplateResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: any(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model EnableTicketTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableTicketTemplateResponseBody(name='body'),
}

/**
 * @param request EnableTicketTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableTicketTemplateResponse
 */
async function enableTicketTemplateWithOptions(request: EnableTicketTemplateRequest, runtime: $RuntimeOptions): EnableTicketTemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'EnableTicketTemplate',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request EnableTicketTemplateRequest
 * @return EnableTicketTemplateResponse
 */
async function enableTicketTemplate(request: EnableTicketTemplateRequest): EnableTicketTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return enableTicketTemplateWithOptions(request, runtime);
}

model EndConferenceRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='9cfad875-6260-4a53-ab6e-b13e3fb31f7d'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-6538214103685****'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model EndConferenceResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelId?: string(name='ChannelId', example='ch:user:131888****->8001****:1609225718294:job-65700074013925376'),
          channelState?: string(name='ChannelState', example='CREATED'),
          destination?: string(name='Destination', example='8001****'),
          jobId?: string(name='JobId', example='job-6538214103685****'),
          originator?: string(name='Originator', example='0830019****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          timestamp?: long(name='Timestamp', example='1609138903315'),
          userExtension?: string(name='UserExtension', example='8032****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    contextId?: long(name='ContextId', example='103655'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      deviceState?: string(name='DeviceState', example='UNREGISTERED'),
      extension?: string(name='Extension', example='8032****'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='0630E5DF-CEB0-445B-8626-D5C7481181C3'),
}

model EndConferenceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EndConferenceResponseBody(name='body'),
}

/**
 * @param request EndConferenceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EndConferenceResponse
 */
async function endConferenceWithOptions(request: EndConferenceRequest, runtime: $RuntimeOptions): EndConferenceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'EndConference',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request EndConferenceRequest
 * @return EndConferenceResponse
 */
async function endConference(request: EndConferenceRequest): EndConferenceResponse {
  var runtime = new $RuntimeOptions{};
  return endConferenceWithOptions(request, runtime);
}

model ExportContactFlowRequest {
  flowId?: string(name='FlowId', description='This parameter is required.', example='lc-uf61xdtm0mf73k'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='9cfad875-6260-4a53-ab6e-b13e3fb3xxxx'),
  requestId?: string(name='RequestId', example='AF9834D8-6D09-4A1B-BADB-B019D9D444C8'),
}

model ExportContactFlowResponseBody = {
  code?: string(name='Code', example='OK'),
  flowPackageData?: string(name='FlowPackageData', example='{}'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='DE803553-8AA9-4B9D-9E4E-A82BC69EDCEE'),
}

model ExportContactFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportContactFlowResponseBody(name='body'),
}

/**
 * @param request ExportContactFlowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportContactFlowResponse
 */
async function exportContactFlowWithOptions(request: ExportContactFlowRequest, runtime: $RuntimeOptions): ExportContactFlowResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.flowId)) {
    body['FlowId'] = request.flowId;
  }
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ExportContactFlow',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ExportContactFlowRequest
 * @return ExportContactFlowResponse
 */
async function exportContactFlow(request: ExportContactFlowRequest): ExportContactFlowResponse {
  var runtime = new $RuntimeOptions{};
  return exportContactFlowWithOptions(request, runtime);
}

model ExportCustomCallTaggingRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model ExportCustomCallTaggingResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='http://ccc-v2-online.oss-cn-shanghai.aliyuncs.com/ccc-test/tagging.xlsx ?Expires=1610910578&amp;OSSAccessKeyId=****&amp;Signature=****'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model ExportCustomCallTaggingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportCustomCallTaggingResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI ExportCustomCallTagging is deprecated, please use CCC::2020-07-01::ExportCustomCallTaggings instead.
 *
 * @summary 导出全部呼入号码标签
 *
 * @param request ExportCustomCallTaggingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportCustomCallTaggingResponse
 */
// Deprecated
async function exportCustomCallTaggingWithOptions(request: ExportCustomCallTaggingRequest, runtime: $RuntimeOptions): ExportCustomCallTaggingResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ExportCustomCallTagging',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @deprecated OpenAPI ExportCustomCallTagging is deprecated, please use CCC::2020-07-01::ExportCustomCallTaggings instead.
 *
 * @summary 导出全部呼入号码标签
 *
 * @param request ExportCustomCallTaggingRequest
 * @return ExportCustomCallTaggingResponse
 */
// Deprecated
async function exportCustomCallTagging(request: ExportCustomCallTaggingRequest): ExportCustomCallTaggingResponse {
  var runtime = new $RuntimeOptions{};
  return exportCustomCallTaggingWithOptions(request, runtime);
}

model ExportDoNotCallNumbersRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  scope?: string(name='Scope', example='INSTANCE'),
  searchPattern?: string(name='SearchPattern', example='RemarkA'),
}

model ExportDoNotCallNumbersResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='https://****.oss-cn-shanghai.aliyuncs.com/ccc-test/blacklist.xlsx?Expires=3294624578&OSSAccessKeyId=****&Signature=****'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model ExportDoNotCallNumbersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportDoNotCallNumbersResponseBody(name='body'),
}

/**
 * @summary 导出黑名单号码
 *
 * @param request ExportDoNotCallNumbersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportDoNotCallNumbersResponse
 */
async function exportDoNotCallNumbersWithOptions(request: ExportDoNotCallNumbersRequest, runtime: $RuntimeOptions): ExportDoNotCallNumbersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.scope)) {
    query['Scope'] = request.scope;
  }
  if (!$isNull(request.searchPattern)) {
    query['SearchPattern'] = request.searchPattern;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ExportDoNotCallNumbers',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 导出黑名单号码
 *
 * @param request ExportDoNotCallNumbersRequest
 * @return ExportDoNotCallNumbersResponse
 */
async function exportDoNotCallNumbers(request: ExportDoNotCallNumbersRequest): ExportDoNotCallNumbersResponse {
  var runtime = new $RuntimeOptions{};
  return exportDoNotCallNumbersWithOptions(request, runtime);
}

model FinishTicketTaskRequest {
  comment?: string(name='Comment', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  taskId?: string(name='TaskId', example='b52a34dc-f514-4600-9c39-3cf657167c97'),
  ticketId?: string(name='TicketId', example='f2c6722b-cd13-442d-bf10-22a07c70d6d5'),
}

model FinishTicketTaskResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: any(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='7BEEA660-A45A-45E3-98CC-AFC65E715C23'),
}

model FinishTicketTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FinishTicketTaskResponseBody(name='body'),
}

/**
 * @param request FinishTicketTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FinishTicketTaskResponse
 */
async function finishTicketTaskWithOptions(request: FinishTicketTaskRequest, runtime: $RuntimeOptions): FinishTicketTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.comment)) {
    query['Comment'] = request.comment;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!$isNull(request.ticketId)) {
    query['TicketId'] = request.ticketId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'FinishTicketTask',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request FinishTicketTaskRequest
 * @return FinishTicketTaskResponse
 */
async function finishTicketTask(request: FinishTicketTaskRequest): FinishTicketTaskResponse {
  var runtime = new $RuntimeOptions{};
  return finishTicketTaskWithOptions(request, runtime);
}

model GetAccessChannelOfStagingRequest {
  searchPattern?: string(name='SearchPattern'),
}

model GetAccessChannelOfStagingResponseBody = {
  code?: string(name='Code'),
  data?: {
    token?: string(name='Token'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model GetAccessChannelOfStagingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAccessChannelOfStagingResponseBody(name='body'),
}

/**
 * @summary GetAccessChannelOfStaging
 *
 * @param request GetAccessChannelOfStagingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAccessChannelOfStagingResponse
 */
async function getAccessChannelOfStagingWithOptions(request: GetAccessChannelOfStagingRequest, runtime: $RuntimeOptions): GetAccessChannelOfStagingResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetAccessChannelOfStaging',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary GetAccessChannelOfStaging
 *
 * @param request GetAccessChannelOfStagingRequest
 * @return GetAccessChannelOfStagingResponse
 */
async function getAccessChannelOfStaging(request: GetAccessChannelOfStagingRequest): GetAccessChannelOfStagingResponse {
  var runtime = new $RuntimeOptions{};
  return getAccessChannelOfStagingWithOptions(request, runtime);
}

model GetAudioFileRequest {
  audioResourceId?: string(name='AudioResourceId', description='This parameter is required.', example='c1a06b46-302a-4c6e-928b-a43c0df485cf'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model GetAudioFileResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    audioFileName?: string(name='AudioFileName', example='test-file.wav'),
    audioResourceId?: string(name='AudioResourceId', example='c1a06b46-302a-4c6e-928b-a43c0df485cf'),
    createdTime?: string(name='CreatedTime', example='2021-07-14 10:48:43.0'),
    instanceId?: string(name='InstanceId', example='ccc-test'),
    name?: string(name='Name'),
    ossFileKey?: string(name='OssFileKey', example='ccc-test/test-file.wav'),
    updatedTime?: string(name='UpdatedTime', example='2021-07-14 10:48:43.0'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEE26562-D921-5CB2-AE49-E4C45A42D432'),
}

model GetAudioFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAudioFileResponseBody(name='body'),
}

/**
 * @summary 获取音频文件
 *
 * @param request GetAudioFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAudioFileResponse
 */
async function getAudioFileWithOptions(request: GetAudioFileRequest, runtime: $RuntimeOptions): GetAudioFileResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.audioResourceId)) {
    query['AudioResourceId'] = request.audioResourceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetAudioFile',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取音频文件
 *
 * @param request GetAudioFileRequest
 * @return GetAudioFileResponse
 */
async function getAudioFile(request: GetAudioFileRequest): GetAudioFileResponse {
  var runtime = new $RuntimeOptions{};
  return getAudioFileWithOptions(request, runtime);
}

model GetAudioFileDownloadUrlRequest {
  audioResourceId?: string(name='AudioResourceId', description='This parameter is required.', example='acc300c4-75c9-41ba-ba5e-2a365c96c248'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model GetAudioFileDownloadUrlResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='https://****.oss-cn-shanghai.aliyuncs.com/ccc-test/****.wav?Expires=1656472158&OSSAccessKeyId=****&Signature=****'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='943D8EF3-3321-471F-A104-51C96FCA94D6'),
}

model GetAudioFileDownloadUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAudioFileDownloadUrlResponseBody(name='body'),
}

/**
 * @param request GetAudioFileDownloadUrlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAudioFileDownloadUrlResponse
 */
async function getAudioFileDownloadUrlWithOptions(request: GetAudioFileDownloadUrlRequest, runtime: $RuntimeOptions): GetAudioFileDownloadUrlResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.audioResourceId)) {
    query['AudioResourceId'] = request.audioResourceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetAudioFileDownloadUrl',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetAudioFileDownloadUrlRequest
 * @return GetAudioFileDownloadUrlResponse
 */
async function getAudioFileDownloadUrl(request: GetAudioFileDownloadUrlRequest): GetAudioFileDownloadUrlResponse {
  var runtime = new $RuntimeOptions{};
  return getAudioFileDownloadUrlWithOptions(request, runtime);
}

model GetAudioFileUploadParametersRequest {
  audioFileName?: string(name='AudioFileName', description='This parameter is required.', example='test-file.wav'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model GetAudioFileUploadParametersResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    accessKeyId?: string(name='AccessKeyId', example='****'),
    expireTime?: int32(name='ExpireTime', example='1647313420'),
    filePath?: string(name='FilePath', example='ccc-test/test-file.wav'),
    host?: string(name='Host', example='https://ccc-v2-online.oss-cn-shanghai.aliyuncs.com'),
    policy?: string(name='Policy', example='eyJleHBpcmF0aW9uIjoiMjAyMi0wNi0yOVQwMDoyOTowMC42NTRaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjBdLFsic3RhcnRzLXdpdGgiLCIka2V5IiwiYXVkaW8vMTU3NzI0NzExNTQ5MDQwMS9seS1vbmxpbmUvMjAyMjA2MjkwNzI5MDAvIl1d****'),
    signature?: string(name='Signature', example='HIyClras8IcVlbTV7RIJWJbU****'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='C81FD1A5-4B99-470A-A527-D80150228784'),
}

model GetAudioFileUploadParametersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAudioFileUploadParametersResponseBody(name='body'),
}

/**
 * @param request GetAudioFileUploadParametersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAudioFileUploadParametersResponse
 */
async function getAudioFileUploadParametersWithOptions(request: GetAudioFileUploadParametersRequest, runtime: $RuntimeOptions): GetAudioFileUploadParametersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.audioFileName)) {
    query['AudioFileName'] = request.audioFileName;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetAudioFileUploadParameters',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetAudioFileUploadParametersRequest
 * @return GetAudioFileUploadParametersResponse
 */
async function getAudioFileUploadParameters(request: GetAudioFileUploadParametersRequest): GetAudioFileUploadParametersResponse {
  var runtime = new $RuntimeOptions{};
  return getAudioFileUploadParametersWithOptions(request, runtime);
}

model GetCallDetailRecordRequest {
  contactId?: string(name='ContactId', description='This parameter is required.', example='job-10963442671187****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model GetCallDetailRecordResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    agentEvents?: [ 
      {
        agentId?: string(name='AgentId', example='agent@ccc-test'),
        agentName?: string(name='AgentName'),
        eventSequence?: [ 
          {
            duration?: long(name='Duration', example='3'),
            event?: string(name='Event', example='Dialing'),
            eventTime?: long(name='EventTime', example='1604639129000'),
          }
        ](name='EventSequence'),
        skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
      }
    ](name='AgentEvents'),
    agentIds?: string(name='AgentIds', example='agent1@ccc-test,agent2@ccc-test'),
    agentNames?: string(name='AgentNames', example='agent1,agent2'),
    analyticsReport?: {
      emotion?: {
        confidence?: int32(name='Confidence'),
        remark?: string(name='Remark'),
        success?: boolean(name='Success'),
        taskId?: string(name='TaskId'),
        type?: string(name='Type'),
      }(name='Emotion'),
      problemSolving?: {
        problem?: string(name='Problem'),
        solution?: string(name='Solution'),
        solved?: boolean(name='Solved'),
        success?: boolean(name='Success'),
        taskId?: string(name='TaskId'),
      }(name='ProblemSolving'),
      satisfaction?: {
        remark?: string(name='Remark'),
        satisfactionDescription?: string(name='SatisfactionDescription'),
        success?: boolean(name='Success'),
        taskId?: string(name='TaskId'),
      }(name='Satisfaction'),
      todoList?: {
        success?: boolean(name='Success'),
        taskId?: string(name='TaskId'),
        tasks?: [ string ](name='Tasks'),
      }(name='TodoList'),
    }(name='AnalyticsReport'),
    analyticsReportReady?: boolean(name='AnalyticsReportReady'),
    callDuration?: long(name='CallDuration', example='50'),
    calledNumber?: string(name='CalledNumber', example='1332315****'),
    calleeLocation?: string(name='CalleeLocation'),
    callerLocation?: string(name='CallerLocation'),
    callingNumber?: string(name='CallingNumber', example='0533128****'),
    contactDisposition?: string(name='ContactDisposition', example='Success'),
    contactId?: string(name='ContactId', example='job-10963442671187****'),
    contactType?: string(name='ContactType'),
    customerEvents?: [ 
      {
        customerId?: string(name='CustomerId', example='1332315****'),
        eventSequence?: [ 
          {
            event?: string(name='Event', example='Released'),
            eventTime?: long(name='EventTime', example='1532458000000'),
          }
        ](name='EventSequence'),
      }
    ](name='CustomerEvents'),
    earlyMediaState?: string(name='EarlyMediaState', example='NotConnected'),
    establishedTime?: long(name='EstablishedTime', example='1532458000000'),
    instanceId?: string(name='InstanceId', example='ccc-test'),
    ivrEvents?: [ 
      {
        eventSequence?: [ 
          {
            event?: string(name='Event', example='Route2IVR'),
            eventTime?: long(name='EventTime', example='1604639129000'),
          }
        ](name='EventSequence'),
        flowId?: string(name='FlowId', example='edaf2eaa-8f88-44ca-812e-41b3cd2b7a90'),
        flowType?: string(name='FlowType', example='MAIN_FLOW'),
      }
    ](name='IvrEvents'),
    queueEvents?: [ 
      {
        eventSequence?: [ 
          {
            event?: string(name='Event', example='Enqueue'),
            eventTime?: long(name='EventTime', example='1604639129000'),
          }
        ](name='EventSequence'),
        flowId?: string(name='FlowId', example='edaf2eaa-8f88-44ca-812e-41b3cd2b7a90'),
        queueId?: string(name='QueueId', example='skillgroup@ccc-test'),
        queueName?: string(name='QueueName'),
        queueType?: int32(name='QueueType', example='1'),
      }
    ](name='QueueEvents'),
    recordingReady?: boolean(name='RecordingReady', example='true'),
    releaseInitiator?: string(name='ReleaseInitiator', example='customer'),
    releaseReason?: string(name='ReleaseReason', example='200 - OK'),
    releaseTime?: long(name='ReleaseTime', example='1532458000000'),
    satisfaction?: int32(name='Satisfaction', example='1'),
    satisfactionSurveyChannel?: string(name='SatisfactionSurveyChannel', example='IVR'),
    satisfactionSurveyOffered?: boolean(name='SatisfactionSurveyOffered', example='true'),
    skillGroupIds?: string(name='SkillGroupIds', example='skillgroup@ccc-test'),
    skillGroupNames?: string(name='SkillGroupNames'),
    startTime?: long(name='StartTime', example='1532458000000'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='7BEEA660-A45A-45E3-98CC-AFC65E715C23'),
}

model GetCallDetailRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCallDetailRecordResponseBody(name='body'),
}

/**
 * @param request GetCallDetailRecordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCallDetailRecordResponse
 */
async function getCallDetailRecordWithOptions(request: GetCallDetailRecordRequest, runtime: $RuntimeOptions): GetCallDetailRecordResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactId)) {
    query['ContactId'] = request.contactId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetCallDetailRecord',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetCallDetailRecordRequest
 * @return GetCallDetailRecordResponse
 */
async function getCallDetailRecord(request: GetCallDetailRecordRequest): GetCallDetailRecordResponse {
  var runtime = new $RuntimeOptions{};
  return getCallDetailRecordWithOptions(request, runtime);
}

model GetCampaignRequest {
  campaignId?: string(name='CampaignId', description='This parameter is required.', example='6badb397-a8b5-40b6-21019d382a09'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model GetCampaignResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    actualEndTime?: long(name='ActualEndTime', example='1634008800000'),
    actualStartTime?: long(name='ActualStartTime', example='1634000460000'),
    campaignId?: string(name='CampaignId', example='6badb397-a8b5-40b6-21019d382a09'),
    casesAborted?: long(name='CasesAborted', example='0'),
    casesConnected?: long(name='CasesConnected', example='40'),
    casesUncompleted?: long(name='CasesUncompleted', example='0'),
    casesUncompletedAfterAttempt?: string(name='CasesUncompletedAfterAttempt'),
    casesUncompletedAfterAttempted?: long(name='CasesUncompletedAfterAttempted', example='1'),
    completionRate?: float(name='CompletionRate'),
    contactFlowId?: string(name='ContactFlowId'),
    maxAttemptCount?: long(name='MaxAttemptCount', example='1'),
    minAttemptInterval?: long(name='MinAttemptInterval', example='1'),
    name?: string(name='Name', example='test-campaign'),
    planedEndTime?: long(name='PlanedEndTime', example='1634054400000'),
    planedStartTime?: long(name='PlanedStartTime', example='1633968000000'),
    queueId?: string(name='QueueId', example='skillgroup@ccc-test'),
    queueName?: string(name='QueueName'),
    simulation?: boolean(name='Simulation', example='false'),
    simulationParameters?: string(name='SimulationParameters'),
    state?: string(name='State', example='Completed'),
    strategyParameters?: string(name='StrategyParameters', example='{"ratio":1}'),
    strategyType?: string(name='StrategyType', example='PACING'),
    totalCases?: long(name='TotalCases', example='100'),
  }(name='Data'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  requestId?: string(name='RequestId', example='6CCEF32F-8614-535F-A1D9-D85B8C0DC4F0'),
}

model GetCampaignResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCampaignResponseBody(name='body'),
}

/**
 * @summary 获取预测式外呼活动信息
 *
 * @param request GetCampaignRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCampaignResponse
 */
async function getCampaignWithOptions(request: GetCampaignRequest, runtime: $RuntimeOptions): GetCampaignResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.campaignId)) {
    query['CampaignId'] = request.campaignId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetCampaign',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取预测式外呼活动信息
 *
 * @param request GetCampaignRequest
 * @return GetCampaignResponse
 */
async function getCampaign(request: GetCampaignRequest): GetCampaignResponse {
  var runtime = new $RuntimeOptions{};
  return getCampaignWithOptions(request, runtime);
}

model GetCaseFileUploadUrlRequest {
  fileName?: string(name='FileName', description='This parameter is required.', example='case.csv'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model GetCaseFileUploadUrlResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    caseFileKey?: string(name='CaseFileKey', example='ccc-test/namelist.csv'),
    url?: string(name='Url', example='https://ccc-v2-online.oss-cn-shanghai.aliyuncs.com/ccc-test/namelist.csv?Expires=1642067227&OSSAccessKeyId=****&Signature=****'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model GetCaseFileUploadUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCaseFileUploadUrlResponseBody(name='body'),
}

/**
 * @param request GetCaseFileUploadUrlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCaseFileUploadUrlResponse
 */
async function getCaseFileUploadUrlWithOptions(request: GetCaseFileUploadUrlRequest, runtime: $RuntimeOptions): GetCaseFileUploadUrlResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetCaseFileUploadUrl',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetCaseFileUploadUrlRequest
 * @return GetCaseFileUploadUrlResponse
 */
async function getCaseFileUploadUrl(request: GetCaseFileUploadUrlRequest): GetCaseFileUploadUrlResponse {
  var runtime = new $RuntimeOptions{};
  return getCaseFileUploadUrlWithOptions(request, runtime);
}

model GetChatMediaUrlRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  mediaId?: string(name='MediaId', description='media id

This parameter is required.', example='$iAHNCNQCo3dhdgMGBAAFAAbaACOEAaQhIEeoAqpjjBl42N6o_kg7A88AAAGRIRRuBgTOACrxHgcACM8AAAGRIYJLBQ'),
  requestId?: string(name='RequestId', example='8707EB29-BAED-4302-B999-40BA61877437'),
}

model GetChatMediaUrlResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='Internal service issue. Detail:.'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='9FBA26B0-462B-4D77-B78F-AF35560DBC71'),
}

model GetChatMediaUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetChatMediaUrlResponseBody(name='body'),
}

/**
 * @param request GetChatMediaUrlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetChatMediaUrlResponse
 */
async function getChatMediaUrlWithOptions(request: GetChatMediaUrlRequest, runtime: $RuntimeOptions): GetChatMediaUrlResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.mediaId)) {
    body['MediaId'] = request.mediaId;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetChatMediaUrl',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetChatMediaUrlRequest
 * @return GetChatMediaUrlResponse
 */
async function getChatMediaUrl(request: GetChatMediaUrlRequest): GetChatMediaUrlResponse {
  var runtime = new $RuntimeOptions{};
  return getChatMediaUrlWithOptions(request, runtime);
}

model GetChatRoutingProfileRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model GetChatRoutingProfileResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    agentConcurrencySettings?: string(name='AgentConcurrencySettings', example='{
    "AllowExceedingLimitWhenTransferring": false,
    "ConcurrencyLimit": 4,
    "AllowExceedingLimitWhenClaiming": true,
    "Enabled": true
}'),
    chatSettings?: string(name='ChatSettings', example='{"IdleChatTimeoutSeconds":300}'),
    distributionSettings?: string(name='DistributionSettings', example='{
    "AgentRingTimeoutSeconds": 30,
    "Enabled": true,
    "MaxNumberOfConversationsAgentCanMiss": 5,
    "PostAgentMissingConversionsAction": "Nothing"
}'),
    routingType?: string(name='RoutingType', example='Automatic'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='30C7D235-DDCF-4C7F-A462-5E2598252C2B'),
}

model GetChatRoutingProfileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetChatRoutingProfileResponseBody(name='body'),
}

/**
 * @param request GetChatRoutingProfileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetChatRoutingProfileResponse
 */
async function getChatRoutingProfileWithOptions(request: GetChatRoutingProfileRequest, runtime: $RuntimeOptions): GetChatRoutingProfileResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetChatRoutingProfile',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetChatRoutingProfileRequest
 * @return GetChatRoutingProfileResponse
 */
async function getChatRoutingProfile(request: GetChatRoutingProfileRequest): GetChatRoutingProfileResponse {
  var runtime = new $RuntimeOptions{};
  return getChatRoutingProfileWithOptions(request, runtime);
}

model GetContactFlowRequest {
  contactFlowId?: string(name='ContactFlowId', description='This parameter is required.', example='274601be-a6d5-4429-bcef-32b51d031c6e'),
  draftId?: string(name='DraftId', description='This parameter is required.', example='566399d7-5558-447c-a72f-9be2768b6a82'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model GetContactFlowResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    contactFlowId?: string(name='ContactFlowId', example='274601be-a6d5-4429-bcef-32b51d031c6e'),
    createdTime?: string(name='CreatedTime', example='2021-07-14 10:48:43.0'),
    definition?: string(name='Definition'),
    description?: string(name='Description', example='1.0'),
    draftId?: string(name='DraftId', example='566399d7-5558-447c-a72f-9be2768b6a82'),
    editor?: string(name='Editor', example='editor-xxx'),
    instanceId?: string(name='InstanceId', example='ccc-test'),
    name?: string(name='Name'),
    published?: boolean(name='Published', example='False'),
    type?: string(name='Type', example='MAIN_FLOW'),
    updatedTime?: string(name='UpdatedTime', example='2021-07-14 10:48:43.0'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='2263B273-AC1B-44EB-BA98-87F2322C6780'),
}

model GetContactFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetContactFlowResponseBody(name='body'),
}

/**
 * @param request GetContactFlowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetContactFlowResponse
 */
async function getContactFlowWithOptions(request: GetContactFlowRequest, runtime: $RuntimeOptions): GetContactFlowResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactFlowId)) {
    query['ContactFlowId'] = request.contactFlowId;
  }
  if (!$isNull(request.draftId)) {
    query['DraftId'] = request.draftId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetContactFlow',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetContactFlowRequest
 * @return GetContactFlowResponse
 */
async function getContactFlow(request: GetContactFlowRequest): GetContactFlowResponse {
  var runtime = new $RuntimeOptions{};
  return getContactFlowWithOptions(request, runtime);
}

model GetConversationDetailRequest {
  contactId?: string(name='ContactId', description='This parameter is required.', example='job-25884193037652****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model GetConversationDetailResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  phrases?: [ 
    {
      begin?: int32(name='Begin', example='240'),
      end?: int32(name='End', example='1280'),
      finished?: boolean(name='Finished'),
      identity?: string(name='Identity', example='agent@ccc-test'),
      role?: string(name='Role'),
      words?: string(name='Words'),
    }
  ](name='Phrases'),
  requestId?: string(name='RequestId', example='7E407F9B-A278-52A0-B193-3EE5471D7A87'),
}

model GetConversationDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetConversationDetailResponseBody(name='body'),
}

/**
 * @summary 获取通话文本信息
 *
 * @param request GetConversationDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetConversationDetailResponse
 */
async function getConversationDetailWithOptions(request: GetConversationDetailRequest, runtime: $RuntimeOptions): GetConversationDetailResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactId)) {
    query['ContactId'] = request.contactId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetConversationDetail',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取通话文本信息
 *
 * @param request GetConversationDetailRequest
 * @return GetConversationDetailResponse
 */
async function getConversationDetail(request: GetConversationDetailRequest): GetConversationDetailResponse {
  var runtime = new $RuntimeOptions{};
  return getConversationDetailWithOptions(request, runtime);
}

model GetDataChannelCredentialsRequest {
  deviceId?: string(name='DeviceId', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
}

model GetDataChannelCredentialsResponseBody = {
  code?: string(name='Code'),
  data?: {
    clientId?: string(name='ClientId'),
    deviceId?: string(name='DeviceId'),
    endpoint?: string(name='Endpoint'),
    expiredTime?: long(name='ExpiredTime'),
    password?: string(name='Password'),
    topic?: string(name='Topic'),
    userName?: string(name='UserName'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId'),
}

model GetDataChannelCredentialsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDataChannelCredentialsResponseBody(name='body'),
}

/**
 * @param request GetDataChannelCredentialsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDataChannelCredentialsResponse
 */
async function getDataChannelCredentialsWithOptions(request: GetDataChannelCredentialsRequest, runtime: $RuntimeOptions): GetDataChannelCredentialsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetDataChannelCredentials',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetDataChannelCredentialsRequest
 * @return GetDataChannelCredentialsResponse
 */
async function getDataChannelCredentials(request: GetDataChannelCredentialsRequest): GetDataChannelCredentialsResponse {
  var runtime = new $RuntimeOptions{};
  return getDataChannelCredentialsWithOptions(request, runtime);
}

model GetDoNotCallFileUploadParametersRequest {
  fileName?: string(name='FileName', description='This parameter is required.', example='blacklist.xlsx'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model GetDoNotCallFileUploadParametersResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    accessKeyId?: string(name='AccessKeyId', example='****'),
    expireTime?: int32(name='ExpireTime', example='1647313420'),
    filePath?: string(name='FilePath', example='ccc-test/blacklist.xlsx'),
    host?: string(name='Host', example='https://ccc-v2-online.oss-cn-shanghai.aliyuncs.com'),
    policy?: string(name='Policy', example='eyJleHBpcmF0aW9uIjoiMjAyMi0wMy0xNVQwMzowMzo0MC4zMTJaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjBdLFsic3RhcnRzLXdpdGgiLCIka2V5IiwidGVtcC9ibGFja2xpc3QvaW1wb3J0LzE1NzcyNDcxMTU0OTA0MDEvY2NjVjIta216LzIwMjIE1MTAwMzQwLyJd****'),
    signature?: string(name='Signature', example='zi31STIMtIfa/UN2l+6lww****'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
  success?: boolean(name='Success', example='true'),
}

model GetDoNotCallFileUploadParametersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDoNotCallFileUploadParametersResponseBody(name='body'),
}

/**
 * @summary 获取黑名单文件上传地址
 *
 * @param request GetDoNotCallFileUploadParametersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDoNotCallFileUploadParametersResponse
 */
async function getDoNotCallFileUploadParametersWithOptions(request: GetDoNotCallFileUploadParametersRequest, runtime: $RuntimeOptions): GetDoNotCallFileUploadParametersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetDoNotCallFileUploadParameters',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取黑名单文件上传地址
 *
 * @param request GetDoNotCallFileUploadParametersRequest
 * @return GetDoNotCallFileUploadParametersResponse
 */
async function getDoNotCallFileUploadParameters(request: GetDoNotCallFileUploadParametersRequest): GetDoNotCallFileUploadParametersResponse {
  var runtime = new $RuntimeOptions{};
  return getDoNotCallFileUploadParametersWithOptions(request, runtime);
}

model GetDocumentUploadParametersRequest {
  fileName?: string(name='FileName', description='This parameter is required.', example='blacklist.xlsx'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='9cfad875-6260-4a53-ab6e-b13e3fb31f7d'),
  requestId?: string(name='RequestId', example='24BE19E8-BF7D-4992-A35E-15EBA874F2E5'),
}

model GetDocumentUploadParametersResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    accessKeyId?: string(name='AccessKeyId', example='****'),
    expireTime?: int32(name='ExpireTime', example='1647313420'),
    filePath?: string(name='FilePath', example='ccc-test/blacklist.xlsx'),
    host?: string(name='Host', description='oss host', example='https://ccc-v2-online.oss-cn-shanghai.aliyuncs.com'),
    policy?: string(name='Policy', example='Permit'),
    signature?: string(name='Signature', example='zi31STIMtIfa/UN2l+6lww****'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='9FBA26B0-462B-4D77-B78F-AF35560DBC71'),
}

model GetDocumentUploadParametersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDocumentUploadParametersResponseBody(name='body'),
}

/**
 * @param request GetDocumentUploadParametersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDocumentUploadParametersResponse
 */
async function getDocumentUploadParametersWithOptions(request: GetDocumentUploadParametersRequest, runtime: $RuntimeOptions): GetDocumentUploadParametersResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.fileName)) {
    body['FileName'] = request.fileName;
  }
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetDocumentUploadParameters',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetDocumentUploadParametersRequest
 * @return GetDocumentUploadParametersResponse
 */
async function getDocumentUploadParameters(request: GetDocumentUploadParametersRequest): GetDocumentUploadParametersResponse {
  var runtime = new $RuntimeOptions{};
  return getDocumentUploadParametersWithOptions(request, runtime);
}

model GetEarlyMediaRecordingRequest {
  contactId?: string(name='ContactId', description='This parameter is required.', example='job-6538214103689****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model GetEarlyMediaRecordingResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    fileName?: string(name='FileName', example='job-6538214103689****-earlyMedia..wav'),
    fileUrl?: string(name='FileUrl', example='https://ccc-v2-online.oss-cn-shanghai.aliyuncs.com/ccc-record-mixed/ccc-test/2022/06/voicemail.job-054ded02****.wav?Expires=1656074923&OSSAccessKeyId=****&Signature=****'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='03C67DAD-EB26-41D8-949D-9B0C470FB716'),
}

model GetEarlyMediaRecordingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetEarlyMediaRecordingResponseBody(name='body'),
}

/**
 * @summary 获取早媒体音频
 *
 * @param request GetEarlyMediaRecordingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetEarlyMediaRecordingResponse
 */
async function getEarlyMediaRecordingWithOptions(request: GetEarlyMediaRecordingRequest, runtime: $RuntimeOptions): GetEarlyMediaRecordingResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactId)) {
    query['ContactId'] = request.contactId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetEarlyMediaRecording',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取早媒体音频
 *
 * @param request GetEarlyMediaRecordingRequest
 * @return GetEarlyMediaRecordingResponse
 */
async function getEarlyMediaRecording(request: GetEarlyMediaRecordingRequest): GetEarlyMediaRecordingResponse {
  var runtime = new $RuntimeOptions{};
  return getEarlyMediaRecordingWithOptions(request, runtime);
}

model GetHistoricalCallerReportRequest {
  callingNumber?: string(name='CallingNumber', description='This parameter is required.', example='1900000****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  startTime?: long(name='StartTime', description='This parameter is required.', example='1646841600000'),
  stopTime?: long(name='StopTime', description='This parameter is required.', example='1646928000000'),
}

model GetHistoricalCallerReportResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    lastCallingTime?: long(name='LastCallingTime', example='1646917200000'),
    totalCalls?: long(name='TotalCalls', example='10'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model GetHistoricalCallerReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHistoricalCallerReportResponseBody(name='body'),
}

/**
 * @param request GetHistoricalCallerReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHistoricalCallerReportResponse
 */
async function getHistoricalCallerReportWithOptions(request: GetHistoricalCallerReportRequest, runtime: $RuntimeOptions): GetHistoricalCallerReportResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.callingNumber)) {
    query['CallingNumber'] = request.callingNumber;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.stopTime)) {
    query['StopTime'] = request.stopTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetHistoricalCallerReport',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetHistoricalCallerReportRequest
 * @return GetHistoricalCallerReportResponse
 */
async function getHistoricalCallerReport(request: GetHistoricalCallerReportRequest): GetHistoricalCallerReportResponse {
  var runtime = new $RuntimeOptions{};
  return getHistoricalCallerReportWithOptions(request, runtime);
}

model GetHistoricalCampaignReportRequest {
  campaignId?: string(name='CampaignId', description='This parameter is required.', example='4fc85829-f6fc-476e-9c0d-c350184e36f1'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model GetHistoricalCampaignReportResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    abandonRate?: float(name='AbandonRate'),
    abandonedRate?: float(name='AbandonedRate', example='0.10'),
    answerRate?: float(name='AnswerRate'),
    callsAbandoned?: long(name='CallsAbandoned', example='5'),
    callsConnected?: long(name='CallsConnected', example='50'),
    callsDialed?: long(name='CallsDialed', example='100'),
    connectedRate?: float(name='ConnectedRate', example='0.50'),
    occupancyRate?: float(name='OccupancyRate', example='0.50'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='E3A847C1-9800-57DF-9172-2CDDC026388D'),
}

model GetHistoricalCampaignReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHistoricalCampaignReportResponseBody(name='body'),
}

/**
 * @summary 获取预测式外呼活动历史报表
 *
 * @param request GetHistoricalCampaignReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHistoricalCampaignReportResponse
 */
async function getHistoricalCampaignReportWithOptions(request: GetHistoricalCampaignReportRequest, runtime: $RuntimeOptions): GetHistoricalCampaignReportResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetHistoricalCampaignReport',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取预测式外呼活动历史报表
 *
 * @param request GetHistoricalCampaignReportRequest
 * @return GetHistoricalCampaignReportResponse
 */
async function getHistoricalCampaignReport(request: GetHistoricalCampaignReportRequest): GetHistoricalCampaignReportResponse {
  var runtime = new $RuntimeOptions{};
  return getHistoricalCampaignReportWithOptions(request, runtime);
}

model GetHistoricalInstanceReportRequest {
  endTime?: long(name='EndTime', example='1532707199000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  mediaType?: string(name='MediaType'),
  startTime?: long(name='StartTime', example='1532448000000'),
}

model GetHistoricalInstanceReportResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    inbound?: {
      abandonRate?: float(name='AbandonRate', example='0'),
      accessChannelTypeDetailList?: [ 
        {
          accessChannelType?: string(name='AccessChannelType'),
          callsOffered?: long(name='CallsOffered'),
        }
      ](name='AccessChannelTypeDetailList'),
      averageAbandonTime?: float(name='AverageAbandonTime', example='0'),
      averageAbandonedInIVRTime?: float(name='AverageAbandonedInIVRTime', example='0'),
      averageAbandonedInQueueTime?: float(name='AverageAbandonedInQueueTime', example='0'),
      averageAbandonedInRingTime?: float(name='AverageAbandonedInRingTime', example='0'),
      averageFirstResponseTime?: float(name='AverageFirstResponseTime'),
      averageHoldTime?: float(name='AverageHoldTime', example='0'),
      averageResponseTime?: float(name='AverageResponseTime'),
      averageRingTime?: float(name='AverageRingTime', example='0'),
      averageTalkTime?: float(name='AverageTalkTime', example='0'),
      averageWaitTime?: float(name='AverageWaitTime', example='0'),
      averageWorkTime?: float(name='AverageWorkTime', example='0'),
      callsAbandoned?: long(name='CallsAbandoned', example='0'),
      callsAbandonedInIVR?: long(name='CallsAbandonedInIVR', example='0'),
      callsAbandonedInQueue?: long(name='CallsAbandonedInQueue', example='0'),
      callsAbandonedInRing?: long(name='CallsAbandonedInRing', example='0'),
      callsAbandonedInVoiceNavigator?: long(name='CallsAbandonedInVoiceNavigator', example='0'),
      callsAttendedTransferred?: long(name='CallsAttendedTransferred', example='0'),
      callsBlindTransferred?: long(name='CallsBlindTransferred', example='0'),
      callsCausedIVRException?: long(name='CallsCausedIVRException'),
      callsForwardToOutsideNumber?: long(name='CallsForwardToOutsideNumber', example='0'),
      callsHandled?: long(name='CallsHandled', example='0'),
      callsHold?: long(name='CallsHold', example='0'),
      callsIVRException?: long(name='CallsIVRException', example='0'),
      callsOffered?: long(name='CallsOffered', example='0'),
      callsQueued?: long(name='CallsQueued', example='0'),
      callsQueuingFailed?: long(name='CallsQueuingFailed', example='0'),
      callsQueuingOverflow?: long(name='CallsQueuingOverflow', example='0'),
      callsQueuingTimeout?: long(name='CallsQueuingTimeout', example='0'),
      callsRinged?: long(name='CallsRinged', example='0'),
      callsToVoicemail?: long(name='CallsToVoicemail'),
      callsVoicemail?: long(name='CallsVoicemail', example='0'),
      handleRate?: float(name='HandleRate', example='0'),
      maxAbandonTime?: long(name='MaxAbandonTime', example='0'),
      maxAbandonedInIVRTime?: long(name='MaxAbandonedInIVRTime', example='100'),
      maxAbandonedInQueueTime?: long(name='MaxAbandonedInQueueTime', example='0'),
      maxAbandonedInRingTime?: long(name='MaxAbandonedInRingTime', example='0'),
      maxHoldTime?: long(name='MaxHoldTime', example='0'),
      maxRingTime?: long(name='MaxRingTime', example='0'),
      maxTalkTime?: long(name='MaxTalkTime', example='0'),
      maxWaitTime?: long(name='MaxWaitTime', example='0'),
      maxWorkTime?: long(name='MaxWorkTime', example='0'),
      satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
      satisfactionRate?: float(name='SatisfactionRate', example='0'),
      satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
      satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
      serviceLevel15?: float(name='ServiceLevel15'),
      serviceLevel20?: float(name='ServiceLevel20', example='0'),
      serviceLevel30?: float(name='ServiceLevel30'),
      totalAbandonTime?: long(name='TotalAbandonTime', example='0'),
      totalAbandonedInIVRTime?: long(name='TotalAbandonedInIVRTime', example='0'),
      totalAbandonedInQueueTime?: long(name='TotalAbandonedInQueueTime', example='0'),
      totalAbandonedInRingTime?: long(name='TotalAbandonedInRingTime', example='0'),
      totalHoldTime?: long(name='TotalHoldTime', example='0'),
      totalMessagesSent?: long(name='TotalMessagesSent'),
      totalMessagesSentByAgent?: long(name='TotalMessagesSentByAgent'),
      totalMessagesSentByCustomer?: long(name='TotalMessagesSentByCustomer'),
      totalRingTime?: long(name='TotalRingTime', example='0'),
      totalTalkTime?: long(name='TotalTalkTime', example='0'),
      totalWaitTime?: long(name='TotalWaitTime', example='0'),
      totalWorkTime?: long(name='TotalWorkTime', example='0'),
    }(name='Inbound'),
    internal?: {
      callsAnswered?: long(name='CallsAnswered'),
      callsDialed?: long(name='CallsDialed'),
    }(name='Internal'),
    outbound?: {
      answerRate?: float(name='AnswerRate', example='0'),
      averageDialingTime?: float(name='AverageDialingTime', example='0'),
      averageHoldTime?: float(name='AverageHoldTime', example='0'),
      averageRingTime?: float(name='AverageRingTime', example='0'),
      averageTalkTime?: float(name='AverageTalkTime', example='0'),
      averageWorkTime?: float(name='AverageWorkTime', example='0'),
      callsAnswered?: long(name='CallsAnswered', example='0'),
      callsAttendedTransferred?: long(name='CallsAttendedTransferred', example='0'),
      callsBlindTransferred?: long(name='CallsBlindTransferred', example='0'),
      callsDialed?: long(name='CallsDialed', example='0'),
      callsHold?: int32(name='CallsHold', example='0'),
      callsRinged?: long(name='CallsRinged', example='0'),
      maxDialingTime?: long(name='MaxDialingTime', example='0'),
      maxHoldTime?: long(name='MaxHoldTime', example='0'),
      maxRingTime?: long(name='MaxRingTime', example='0'),
      maxTalkTime?: long(name='MaxTalkTime', example='0'),
      maxWorkTime?: long(name='MaxWorkTime', example='0'),
      satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
      satisfactionRate?: float(name='SatisfactionRate', example='0'),
      satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
      satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
      totalDialingTime?: long(name='TotalDialingTime', example='0'),
      totalHoldTime?: long(name='TotalHoldTime', example='0'),
      totalRingTime?: long(name='TotalRingTime', example='0'),
      totalTalkTime?: long(name='TotalTalkTime', example='0'),
      totalWorkTime?: long(name='TotalWorkTime', example='0'),
    }(name='Outbound'),
    overall?: {
      averageBreakTime?: float(name='AverageBreakTime', example='0'),
      averageHoldTime?: float(name='AverageHoldTime', example='0'),
      averageReadyTime?: float(name='AverageReadyTime', example='0'),
      averageTalkTime?: float(name='AverageTalkTime', example='0'),
      averageWorkTime?: float(name='AverageWorkTime', example='0'),
      maxBreakTime?: long(name='MaxBreakTime', example='0'),
      maxHoldTime?: long(name='MaxHoldTime', example='0'),
      maxLoggedInAgents?: long(name='MaxLoggedInAgents'),
      maxReadyTime?: long(name='MaxReadyTime', example='0'),
      maxTalkTime?: long(name='MaxTalkTime', example='0'),
      maxWorkTime?: long(name='MaxWorkTime', example='0'),
      occupancyRate?: float(name='OccupancyRate', example='0'),
      satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
      satisfactionRate?: float(name='SatisfactionRate', example='0'),
      satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
      satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
      totalBreakTime?: long(name='TotalBreakTime', example='0'),
      totalCalls?: long(name='TotalCalls', example='0'),
      totalHoldTime?: long(name='TotalHoldTime', example='0'),
      totalLoggedInTime?: long(name='TotalLoggedInTime', example='0'),
      totalReadyTime?: long(name='TotalReadyTime', example='0'),
      totalTalkTime?: long(name='TotalTalkTime', example='0'),
      totalWorkTime?: long(name='TotalWorkTime', example='0'),
    }(name='Overall'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='943D8EF3-3321-471F-A104-51C96FCA94D6'),
}

model GetHistoricalInstanceReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHistoricalInstanceReportResponseBody(name='body'),
}

/**
 * @param request GetHistoricalInstanceReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHistoricalInstanceReportResponse
 */
async function getHistoricalInstanceReportWithOptions(request: GetHistoricalInstanceReportRequest, runtime: $RuntimeOptions): GetHistoricalInstanceReportResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetHistoricalInstanceReport',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetHistoricalInstanceReportRequest
 * @return GetHistoricalInstanceReportResponse
 */
async function getHistoricalInstanceReport(request: GetHistoricalInstanceReportRequest): GetHistoricalInstanceReportResponse {
  var runtime = new $RuntimeOptions{};
  return getHistoricalInstanceReportWithOptions(request, runtime);
}

model GetInstanceRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model GetInstanceResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    adminList?: [ 
      {
        displayName?: string(name='DisplayName'),
        email?: string(name='Email', example='username@example.com'),
        extension?: string(name='Extension', example='8032****'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        loginName?: string(name='LoginName', example='agent'),
        mobile?: string(name='Mobile', example='1382114****'),
        roleId?: string(name='RoleId', example='Admin@ccc-test'),
        roleName?: string(name='RoleName', example='Admin'),
        userId?: string(name='UserId', example='agent@ccc-test'),
        workMode?: string(name='WorkMode', example='ON_SITE'),
      }
    ](name='AdminList'),
    aliyunUid?: string(name='AliyunUid', example='157123456789****'),
    consoleUrl?: string(name='ConsoleUrl', example='https://ccc-v2.aliyun.com/#/workbench/ccc-test'),
    description?: string(name='Description'),
    domainName?: string(name='DomainName', example='ccc-test'),
    id?: string(name='Id', example='ccc-test'),
    name?: string(name='Name'),
    numberList?: [ 
      {
        active?: boolean(name='Active', example='true'),
        city?: string(name='City'),
        contactFlowId?: string(name='ContactFlowId', example='2ec7a58f-3243-4815-bb21-97b480b95f5e'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        number?: string(name='Number', example='0830011****'),
        province?: string(name='Province'),
        skillGroups?: [ 
          {
            description?: string(name='Description'),
            displayName?: string(name='DisplayName'),
            instanceId?: string(name='InstanceId', example='ccc-test'),
            name?: string(name='Name', example='skillgroup'),
            phoneNumberCount?: int32(name='PhoneNumberCount', example='1'),
            skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
            userCount?: int32(name='UserCount', example='3'),
          }
        ](name='SkillGroups'),
        usage?: string(name='Usage', example='Bidirection'),
        userId?: string(name='UserId', example='agent@ccc-test'),
      }
    ](name='NumberList'),
    status?: string(name='Status', example='RUNNING'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='2778FA12-EDD6-42AA-9B15-AF855072E5E5'),
}

model GetInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInstanceResponseBody(name='body'),
}

/**
 * @param request GetInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInstanceResponse
 */
async function getInstanceWithOptions(request: GetInstanceRequest, runtime: $RuntimeOptions): GetInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetInstance',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetInstanceRequest
 * @return GetInstanceResponse
 */
async function getInstance(request: GetInstanceRequest): GetInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return getInstanceWithOptions(request, runtime);
}

model GetInstanceTrendingReportRequest {
  endTime?: long(name='EndTime', example='1604725528000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  mediaType?: string(name='MediaType'),
  startTime?: long(name='StartTime', example='1604639129000'),
}

model GetInstanceTrendingReportResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    inbound?: [ 
      {
        callsAbandonedInIVR?: long(name='CallsAbandonedInIVR', example='0'),
        callsAbandonedInQueue?: long(name='CallsAbandonedInQueue', example='0'),
        callsAbandonedInRing?: long(name='CallsAbandonedInRing', example='0'),
        callsHandled?: long(name='CallsHandled', example='0'),
        callsQueued?: long(name='CallsQueued', example='0'),
        statsTime?: long(name='StatsTime', example='1604639129000'),
        totalCalls?: long(name='TotalCalls', example='0'),
      }
    ](name='Inbound'),
    outbound?: [ 
      {
        callsAnswered?: long(name='CallsAnswered', example='0'),
        statsTime?: long(name='StatsTime', example='1604639129000'),
        totalCalls?: long(name='TotalCalls', example='0'),
      }
    ](name='Outbound'),
    overall?: [ 
      {
        maxLoggedInAgents?: long(name='MaxLoggedInAgents'),
        statsTime?: long(name='StatsTime'),
      }
    ](name='Overall'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='943D8EF3-3321-471F-A104-51C96FCA94D6'),
}

model GetInstanceTrendingReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInstanceTrendingReportResponseBody(name='body'),
}

/**
 * @param request GetInstanceTrendingReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInstanceTrendingReportResponse
 */
async function getInstanceTrendingReportWithOptions(request: GetInstanceTrendingReportRequest, runtime: $RuntimeOptions): GetInstanceTrendingReportResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetInstanceTrendingReport',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetInstanceTrendingReportRequest
 * @return GetInstanceTrendingReportResponse
 */
async function getInstanceTrendingReport(request: GetInstanceTrendingReportRequest): GetInstanceTrendingReportResponse {
  var runtime = new $RuntimeOptions{};
  return getInstanceTrendingReportWithOptions(request, runtime);
}

model GetIvrTrackingSummaryRequest {
  contactId?: string(name='ContactId', description='This parameter is required.', example='job-489361145506897920'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='0f7ad007-ab50-4b3d-a87a-56864eb40dab'),
}

model GetIvrTrackingSummaryResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='Unknown error code \\\\"NoPermission.Recording\\\\". Reason: null'),
  requestId?: string(name='RequestId', example='DE803553-8AA9-4B9D-9E4E-A82BC69EDCEE'),
}

model GetIvrTrackingSummaryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetIvrTrackingSummaryResponseBody(name='body'),
}

/**
 * @param request GetIvrTrackingSummaryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetIvrTrackingSummaryResponse
 */
async function getIvrTrackingSummaryWithOptions(request: GetIvrTrackingSummaryRequest, runtime: $RuntimeOptions): GetIvrTrackingSummaryResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactId)) {
    query['ContactId'] = request.contactId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetIvrTrackingSummary',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetIvrTrackingSummaryRequest
 * @return GetIvrTrackingSummaryResponse
 */
async function getIvrTrackingSummary(request: GetIvrTrackingSummaryRequest): GetIvrTrackingSummaryResponse {
  var runtime = new $RuntimeOptions{};
  return getIvrTrackingSummaryWithOptions(request, runtime);
}

model GetLoginDetailsRequest {
  chatDeviceId?: string(name='ChatDeviceId'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model GetLoginDetailsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    agentServerUrl?: string(name='AgentServerUrl', example='sh-wss-ccc.aliyuncs.com'),
    avatarUrl?: string(name='AvatarUrl'),
    chatAppId?: string(name='ChatAppId'),
    chatAppKey?: string(name='ChatAppKey'),
    chatDeviceId?: string(name='ChatDeviceId'),
    chatLoginToken?: string(name='ChatLoginToken'),
    chatServerUrl?: string(name='ChatServerUrl'),
    chatUserId?: string(name='ChatUserId'),
    deviceExt?: string(name='DeviceExt', example='8033****'),
    deviceId?: string(name='DeviceId', example='Yealink SIP-T23G 44.84.XX.XX'),
    deviceState?: string(name='DeviceState', example='OFFLINE'),
    displayName?: string(name='DisplayName'),
    extension?: string(name='Extension', example='8001****'),
    nickname?: string(name='Nickname'),
    signature?: string(name='Signature', example='zi31STIMtIfa/UN2l+6lww****'),
    signature2?: string(name='Signature2', example='zi31STIMtIfa/UN2l+6lww****'),
    sipServerUrl?: string(name='SipServerUrl', example='sh-sip-ccc.aliyuncs.com:443'),
    userId?: string(name='UserId', example='agent@ccc-test'),
    userKey?: string(name='UserKey'),
    userKey2?: string(name='UserKey2', example='802001:1656406628862"'),
    workMode?: string(name='WorkMode', example='ON_SITE'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='F1A4774A-F28B-5C40-AEF6-D88D2DD6C7E4'),
}

model GetLoginDetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetLoginDetailsResponseBody(name='body'),
}

/**
 * @param request GetLoginDetailsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetLoginDetailsResponse
 */
async function getLoginDetailsWithOptions(request: GetLoginDetailsRequest, runtime: $RuntimeOptions): GetLoginDetailsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.chatDeviceId)) {
    query['ChatDeviceId'] = request.chatDeviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetLoginDetails',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetLoginDetailsRequest
 * @return GetLoginDetailsResponse
 */
async function getLoginDetails(request: GetLoginDetailsRequest): GetLoginDetailsResponse {
  var runtime = new $RuntimeOptions{};
  return getLoginDetailsWithOptions(request, runtime);
}

model GetMonoRecordingRequest {
  contactId?: string(name='ContactId', description='This parameter is required.', example='job-6538214103689****'),
  expireSeconds?: long(name='ExpireSeconds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model GetMonoRecordingResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    duration?: long(name='Duration'),
    fileName?: string(name='FileName', example='job-6538214103689****.wav'),
    fileUrl?: string(name='FileUrl', example='http://ccc-v2-online.oss-cn-shanghai.aliyuncs.com/ccc-record/job-6538214103689****.wav?Expires=1610910578&OSSAccessKeyId=****&Signature=****'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model GetMonoRecordingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMonoRecordingResponseBody(name='body'),
}

/**
 * @param request GetMonoRecordingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMonoRecordingResponse
 */
async function getMonoRecordingWithOptions(request: GetMonoRecordingRequest, runtime: $RuntimeOptions): GetMonoRecordingResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactId)) {
    query['ContactId'] = request.contactId;
  }
  if (!$isNull(request.expireSeconds)) {
    query['ExpireSeconds'] = request.expireSeconds;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMonoRecording',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetMonoRecordingRequest
 * @return GetMonoRecordingResponse
 */
async function getMonoRecording(request: GetMonoRecordingRequest): GetMonoRecordingResponse {
  var runtime = new $RuntimeOptions{};
  return getMonoRecordingWithOptions(request, runtime);
}

model GetMultiChannelRecordingRequest {
  contactId?: string(name='ContactId', description='This parameter is required.', example='job-6538214103689****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model GetMultiChannelRecordingResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    fileName?: string(name='FileName', example='job-6538214103689****.mkv'),
    fileUrl?: string(name='FileUrl', example='https://ccc-v2-online.oss-cn-shanghai.aliyuncs.com/ccc-record-mixed/ccc-test/2021/04/job-6538214103689****.mkv?Expires=1617435462&OSSAccessKeyId=****&Signature=****'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model GetMultiChannelRecordingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMultiChannelRecordingResponseBody(name='body'),
}

/**
 * @param request GetMultiChannelRecordingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMultiChannelRecordingResponse
 */
async function getMultiChannelRecordingWithOptions(request: GetMultiChannelRecordingRequest, runtime: $RuntimeOptions): GetMultiChannelRecordingResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactId)) {
    query['ContactId'] = request.contactId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMultiChannelRecording',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetMultiChannelRecordingRequest
 * @return GetMultiChannelRecordingResponse
 */
async function getMultiChannelRecording(request: GetMultiChannelRecordingRequest): GetMultiChannelRecordingResponse {
  var runtime = new $RuntimeOptions{};
  return getMultiChannelRecordingWithOptions(request, runtime);
}

model GetNumberLocationRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  number?: string(name='Number', description='This parameter is required.', example='1312121****'),
}

model GetNumberLocationResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    city?: string(name='City'),
    number?: string(name='Number', example='1312121****'),
    province?: string(name='Province'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='584AA2E3-9AC4-561B-BC8D-C74BA11B1387'),
}

model GetNumberLocationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetNumberLocationResponseBody(name='body'),
}

/**
 * @param request GetNumberLocationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetNumberLocationResponse
 */
async function getNumberLocationWithOptions(request: GetNumberLocationRequest, runtime: $RuntimeOptions): GetNumberLocationResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.number)) {
    query['Number'] = request.number;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetNumberLocation',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetNumberLocationRequest
 * @return GetNumberLocationResponse
 */
async function getNumberLocation(request: GetNumberLocationRequest): GetNumberLocationResponse {
  var runtime = new $RuntimeOptions{};
  return getNumberLocationWithOptions(request, runtime);
}

model GetRealtimeCampaignStatsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  queueId?: string(name='QueueId', description='This parameter is required.', example='skillgroup@ccc-test'),
}

model GetRealtimeCampaignStatsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    breakingAgents?: long(name='BreakingAgents', example='1'),
    caps?: long(name='Caps', example='5'),
    loggedInAgents?: long(name='LoggedInAgents', example='10'),
    outboundScenarioBreakingAgents?: long(name='OutboundScenarioBreakingAgents'),
    outboundScenarioReadyAgents?: long(name='OutboundScenarioReadyAgents'),
    outboundScenarioTalkingAgents?: long(name='OutboundScenarioTalkingAgents'),
    outboundScenarioWorkingAgents?: long(name='OutboundScenarioWorkingAgents'),
    readyAgents?: long(name='ReadyAgents', example='3'),
    talkingAgents?: long(name='TalkingAgents', example='4'),
    totalAgents?: long(name='TotalAgents', example='10'),
    workingAgents?: long(name='WorkingAgents', example='2'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='42970829-E2C8-515A-8F42-5A6B59F852A7'),
}

model GetRealtimeCampaignStatsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRealtimeCampaignStatsResponseBody(name='body'),
}

/**
 * @summary 获取预测式外呼实时状态
 *
 * @param request GetRealtimeCampaignStatsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRealtimeCampaignStatsResponse
 */
async function getRealtimeCampaignStatsWithOptions(request: GetRealtimeCampaignStatsRequest, runtime: $RuntimeOptions): GetRealtimeCampaignStatsResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetRealtimeCampaignStats',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取预测式外呼实时状态
 *
 * @param request GetRealtimeCampaignStatsRequest
 * @return GetRealtimeCampaignStatsResponse
 */
async function getRealtimeCampaignStats(request: GetRealtimeCampaignStatsRequest): GetRealtimeCampaignStatsResponse {
  var runtime = new $RuntimeOptions{};
  return getRealtimeCampaignStatsWithOptions(request, runtime);
}

model GetRealtimeInstanceStatesRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  mediaType?: string(name='MediaType'),
}

model GetRealtimeInstanceStatesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    breakCodeDetailList?: [ 
      {
        breakCode?: string(name='BreakCode'),
        count?: long(name='Count'),
      }
    ](name='BreakCodeDetailList'),
    breakingAgents?: long(name='BreakingAgents', example='0'),
    instanceId?: string(name='InstanceId', example='ccc-test'),
    interactiveCalls?: long(name='InteractiveCalls', example='0'),
    loggedInAgents?: long(name='LoggedInAgents', example='0'),
    longestWaitingTime?: long(name='LongestWaitingTime', example='0'),
    readyAgents?: long(name='ReadyAgents', example='0'),
    talkingAgents?: long(name='TalkingAgents', example='0'),
    totalAgents?: long(name='TotalAgents', example='0'),
    waitingCalls?: long(name='WaitingCalls', example='0'),
    workingAgents?: long(name='WorkingAgents', example='0'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='943D8EF3-3321-471F-A104-51C96FCA94D6'),
}

model GetRealtimeInstanceStatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRealtimeInstanceStatesResponseBody(name='body'),
}

/**
 * @param request GetRealtimeInstanceStatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRealtimeInstanceStatesResponse
 */
async function getRealtimeInstanceStatesWithOptions(request: GetRealtimeInstanceStatesRequest, runtime: $RuntimeOptions): GetRealtimeInstanceStatesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetRealtimeInstanceStates',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetRealtimeInstanceStatesRequest
 * @return GetRealtimeInstanceStatesResponse
 */
async function getRealtimeInstanceStates(request: GetRealtimeInstanceStatesRequest): GetRealtimeInstanceStatesResponse {
  var runtime = new $RuntimeOptions{};
  return getRealtimeInstanceStatesWithOptions(request, runtime);
}

model GetSchemaRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='b0eb2742-f37e-4c67-82d4-25c651c1xxxx'),
  requestId?: string(name='RequestId', example='03C67DAD-EB26-41D8-949D-9B0C470FB716'),
  schemaId?: string(name='SchemaId', description='schema id

This parameter is required.', example='profile'),
}

model GetSchemaResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    createdTime?: string(name='CreatedTime', example='2021-07-14 10:48:43.0'),
    deleted?: boolean(name='Deleted', example='false'),
    description?: string(name='Description'),
    id?: string(name='Id', description='schema id', example='profile'),
    instanceId?: string(name='InstanceId', example='5e0964fd-951c-4e45-b518-d09d4d2db8ca'),
    properties?: map[string]DataPropertiesValue(name='Properties'),
    updatedTime?: string(name='UpdatedTime', example='2021-07-14 10:48:43.0'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='Service abnormal, the instance 0418 is ceased.'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='19D09CCC-F298-4124-849A-AFA217819011'),
}

model GetSchemaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSchemaResponseBody(name='body'),
}

/**
 * @param request GetSchemaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSchemaResponse
 */
async function getSchemaWithOptions(request: GetSchemaRequest, runtime: $RuntimeOptions): GetSchemaResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  if (!$isNull(request.schemaId)) {
    body['SchemaId'] = request.schemaId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetSchema',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetSchemaRequest
 * @return GetSchemaResponse
 */
async function getSchema(request: GetSchemaRequest): GetSchemaResponse {
  var runtime = new $RuntimeOptions{};
  return getSchemaWithOptions(request, runtime);
}

model GetSkillGroupRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  skillGroupId?: string(name='SkillGroupId', description='This parameter is required.', example='skillgroup@ccc-test'),
}

model GetSkillGroupResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    description?: string(name='Description'),
    displayName?: string(name='DisplayName'),
    instanceId?: string(name='InstanceId', example='ccc-test'),
    mediaType?: string(name='MediaType'),
    name?: string(name='Name', example='skillgroup'),
    skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='CF1C21B9-2D49-4B54-880F-FBE248C16903'),
}

model GetSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSkillGroupResponseBody(name='body'),
}

/**
 * @summary 查询技能组
 *
 * @param request GetSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSkillGroupResponse
 */
async function getSkillGroupWithOptions(request: GetSkillGroupRequest, runtime: $RuntimeOptions): GetSkillGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetSkillGroup',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询技能组
 *
 * @param request GetSkillGroupRequest
 * @return GetSkillGroupResponse
 */
async function getSkillGroup(request: GetSkillGroupRequest): GetSkillGroupResponse {
  var runtime = new $RuntimeOptions{};
  return getSkillGroupWithOptions(request, runtime);
}

model GetSummaryTemplateRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  templateId?: string(name='TemplateId', description='This parameter is required.', example='43c2671b-8939-4223-86d0-6bd187905cc8_1717664210492'),
}

model GetSummaryTemplateResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    categoryId?: string(name='CategoryId', example='8939-4223-86d0-6bd187905cc8'),
    editor?: string(name='Editor', example='editor-xxx@ccc-test'),
    instanceId?: string(name='InstanceId', example='ccc-test'),
    name?: string(name='Name'),
    propertyList?: [ 
      {
        array?: boolean(name='Array', example='false'),
        attributes?: string(name='Attributes', example='{}'),
        createdTime?: long(name='CreatedTime', example='1717664210000'),
        creator?: string(name='Creator', example='cretor-xxx@ccc-test'),
        dataType?: string(name='DataType', example='string'),
        description?: string(name='Description', example='Description-xxxx'),
        disabled?: boolean(name='Disabled', example='false'),
        displayName?: string(name='DisplayName', example='DisplayName-A'),
        displayOrder?: int32(name='DisplayOrder', example='1'),
        editorType?: string(name='EditorType', example='textbox'),
        maxLength?: int32(name='MaxLength', example='30'),
        maximum?: double(name='Maximum', example='10'),
        minLength?: int32(name='MinLength', example='1'),
        minimum?: double(name='Minimum', example='1'),
        name?: string(name='Name', example='Name-A'),
        pattern?: string(name='Pattern', example='^'),
        patternErrorMessage?: string(name='PatternErrorMessage'),
        readOnly?: boolean(name='ReadOnly', example='false'),
        required?: boolean(name='Required', example='false'),
        system?: boolean(name='System', example='false'),
        updatedTime?: long(name='UpdatedTime', example='1717664210000'),
      }
    ](name='PropertyList'),
    state?: string(name='State', example='Enabled'),
    templateId?: string(name='TemplateId', example='43c2671b-8939-4223-86d0-6bd187905cc8_1717664210492'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='30C7D235-DDCF-4C7F-A462-5E2598252C2B'),
}

model GetSummaryTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSummaryTemplateResponseBody(name='body'),
}

/**
 * @param request GetSummaryTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSummaryTemplateResponse
 */
async function getSummaryTemplateWithOptions(request: GetSummaryTemplateRequest, runtime: $RuntimeOptions): GetSummaryTemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetSummaryTemplate',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetSummaryTemplateRequest
 * @return GetSummaryTemplateResponse
 */
async function getSummaryTemplate(request: GetSummaryTemplateRequest): GetSummaryTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return getSummaryTemplateWithOptions(request, runtime);
}

model GetTicketRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  ticketId?: string(name='TicketId', description='This parameter is required.', example='3d26b90a-c5d2-4b09-8219-********'),
}

model GetTicketResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    assignee?: string(name='Assignee', example='agent1@ccc-test'),
    assigneeName?: string(name='AssigneeName'),
    categoryId?: string(name='CategoryId', example='8939-4223-86d0-6bd187905cc8'),
    categoryName?: string(name='CategoryName'),
    closeCode?: string(name='CloseCode', example='Completed'),
    comment?: string(name='Comment'),
    context?: string(name='Context'),
    createdTime?: long(name='CreatedTime', example='1620259200000'),
    creator?: string(name='Creator', example='creator@ccc-test'),
    creatorName?: string(name='CreatorName'),
    currentTaskId?: string(name='CurrentTaskId', example='912f0b78-6639-4a93-ae18-0d832885c27e'),
    currentTaskName?: string(name='CurrentTaskName'),
    currentTaskStartTime?: long(name='CurrentTaskStartTime', example='1693793208075'),
    customerId?: string(name='CustomerId', example='4223-86d0-6bd187905-891798749'),
    endTime?: long(name='EndTime', example='1687846259999'),
    instanceId?: string(name='InstanceId', example='ccc-test'),
    jobId?: string(name='JobId', example='job-399383842187575296'),
    source?: string(name='Source', example='Audio'),
    startTime?: long(name='StartTime', example='1620259200000'),
    state?: string(name='State', example='Processing'),
    templateId?: string(name='TemplateId', example='ccc-test_43c2671b-8939-4223-86d0-6bd187905cc8_*****0666238'),
    templateVersion?: string(name='TemplateVersion', example='0'),
    ticketId?: string(name='TicketId', example='b3a6a131-359e-46bd-9bc5-1f5cb0ea093f'),
    title?: string(name='Title'),
    updatedTime?: long(name='UpdatedTime', example='1693793208075'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='BF268B34-09C2-43FD-BAC4-5D31EA633111'),
}

model GetTicketResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTicketResponseBody(name='body'),
}

/**
 * @param request GetTicketRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTicketResponse
 */
async function getTicketWithOptions(request: GetTicketRequest, runtime: $RuntimeOptions): GetTicketResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ticketId)) {
    query['TicketId'] = request.ticketId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetTicket',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetTicketRequest
 * @return GetTicketResponse
 */
async function getTicket(request: GetTicketRequest): GetTicketResponse {
  var runtime = new $RuntimeOptions{};
  return getTicketWithOptions(request, runtime);
}

model GetTicketSummaryReportRequest {
  assignee?: string(name='Assignee', example='assignee@ccc-test'),
  assigneeType?: string(name='AssigneeType', example='Agent'),
  categoryId?: string(name='CategoryId', example='43c2671b-***-***-86d0-6bd187905cc8'),
  creator?: string(name='Creator', example='creator@ccc-test'),
  endTime?: long(name='EndTime', example='1719590399999'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='100'),
  participant?: string(name='Participant', example='participant@ccc-test'),
  startTime?: long(name='StartTime', example='1716998400000'),
  state?: string(name='State'),
}

model GetTicketSummaryReportResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    ticketsAssigned?: string(name='TicketsAssigned', example='3'),
    ticketsCreated?: string(name='TicketsCreated', example='10'),
    ticketsParticipated?: string(name='TicketsParticipated', example='5'),
  }(name='Data'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EAF3C248-E123-441B-A545-B6CD02E98EED'),
}

model GetTicketSummaryReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTicketSummaryReportResponseBody(name='body'),
}

/**
 * @param request GetTicketSummaryReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTicketSummaryReportResponse
 */
async function getTicketSummaryReportWithOptions(request: GetTicketSummaryReportRequest, runtime: $RuntimeOptions): GetTicketSummaryReportResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.assignee)) {
    query['Assignee'] = request.assignee;
  }
  if (!$isNull(request.assigneeType)) {
    query['AssigneeType'] = request.assigneeType;
  }
  if (!$isNull(request.categoryId)) {
    query['CategoryId'] = request.categoryId;
  }
  if (!$isNull(request.creator)) {
    query['Creator'] = request.creator;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.participant)) {
    query['Participant'] = request.participant;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.state)) {
    query['State'] = request.state;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetTicketSummaryReport',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetTicketSummaryReportRequest
 * @return GetTicketSummaryReportResponse
 */
async function getTicketSummaryReport(request: GetTicketSummaryReportRequest): GetTicketSummaryReportResponse {
  var runtime = new $RuntimeOptions{};
  return getTicketSummaryReportWithOptions(request, runtime);
}

model GetTicketTemplateRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  templateId?: string(name='TemplateId', example='4ca2e2-c8d19b82c-d7ce393ac8197d3ab'),
  templateVersion?: string(name='TemplateVersion', example='1703517780627'),
}

model GetTicketTemplateResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    categoryId?: string(name='CategoryId', example='43c2671b-****-4223-86d0-6bd187905cc8'),
    editor?: string(name='Editor', example='editor-xxx@ccc-test'),
    instanceId?: string(name='InstanceId', example='ccc-test'),
    name?: string(name='Name'),
    processDefinition?: string(name='ProcessDefinition'),
    state?: string(name='State', example='Enabled'),
    templateId?: string(name='TemplateId', example='4ca2e2-c8d19b82c-d7ce393ac8197d3ab'),
    ticketFields?: [ 
      {
        array?: boolean(name='Array', example='false'),
        attributes?: string(name='Attributes', example='{}'),
        createdTime?: long(name='CreatedTime', example='1717664210000'),
        creator?: string(name='Creator', example='creator@cccV2-kmz'),
        dataType?: string(name='DataType', example='string'),
        description?: string(name='Description'),
        disabled?: boolean(name='Disabled', example='false'),
        displayName?: string(name='DisplayName'),
        displayOrder?: int32(name='DisplayOrder', example='1'),
        editorType?: string(name='EditorType', example='textbox'),
        maxLength?: int32(name='MaxLength', example='30'),
        maximum?: double(name='Maximum', example='10'),
        minLength?: int32(name='MinLength', example='1'),
        minimum?: double(name='Minimum', example='1'),
        name?: string(name='Name', example='name'),
        pattern?: string(name='Pattern', example='^'),
        patternErrorMessage?: string(name='PatternErrorMessage'),
        readOnly?: boolean(name='ReadOnly', example='false'),
        required?: boolean(name='Required', example='false'),
        system?: boolean(name='System', example='false'),
        updatedTime?: long(name='UpdatedTime', example='1717664210000'),
      }
    ](name='TicketFields'),
    updatedTime?: long(name='UpdatedTime', example='1717664210000'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='BF268B34-09C2-43FD-BAC4-5D31EA633111'),
}

model GetTicketTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTicketTemplateResponseBody(name='body'),
}

/**
 * @param request GetTicketTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTicketTemplateResponse
 */
async function getTicketTemplateWithOptions(request: GetTicketTemplateRequest, runtime: $RuntimeOptions): GetTicketTemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  if (!$isNull(request.templateVersion)) {
    query['TemplateVersion'] = request.templateVersion;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetTicketTemplate',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetTicketTemplateRequest
 * @return GetTicketTemplateResponse
 */
async function getTicketTemplate(request: GetTicketTemplateRequest): GetTicketTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return getTicketTemplateWithOptions(request, runtime);
}

model GetTurnCredentialsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model GetTurnCredentialsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    password?: string(name='Password', example='M0NQNG/uRUrfIxW7er/S9gKX****'),
    userName?: string(name='UserName', example='1602585817:****'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model GetTurnCredentialsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTurnCredentialsResponseBody(name='body'),
}

/**
 * @param request GetTurnCredentialsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTurnCredentialsResponse
 */
async function getTurnCredentialsWithOptions(request: GetTurnCredentialsRequest, runtime: $RuntimeOptions): GetTurnCredentialsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetTurnCredentials',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetTurnCredentialsRequest
 * @return GetTurnCredentialsResponse
 */
async function getTurnCredentials(request: GetTurnCredentialsRequest): GetTurnCredentialsResponse {
  var runtime = new $RuntimeOptions{};
  return getTurnCredentialsWithOptions(request, runtime);
}

model GetTurnServerListRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model GetTurnServerListResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId'),
}

model GetTurnServerListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTurnServerListResponseBody(name='body'),
}

/**
 * @param request GetTurnServerListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTurnServerListResponse
 */
async function getTurnServerListWithOptions(request: GetTurnServerListRequest, runtime: $RuntimeOptions): GetTurnServerListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetTurnServerList',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetTurnServerListRequest
 * @return GetTurnServerListResponse
 */
async function getTurnServerList(request: GetTurnServerListRequest): GetTurnServerListResponse {
  var runtime = new $RuntimeOptions{};
  return getTurnServerListWithOptions(request, runtime);
}

model GetUploadAudioDataParamsRequest {
  contactId?: string(name='ContactId', description='This parameter is required.', example='job-38860977107324****'),
  instanceId?: string(name='InstanceId', example='test'),
}

model GetUploadAudioDataParamsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    paramsStr?: string(name='ParamsStr'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='03C67DAD-EB26-41D8-949D-9B0C470FB716'),
}

model GetUploadAudioDataParamsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUploadAudioDataParamsResponseBody(name='body'),
}

/**
 * @summary 获取质检参数
 *
 * @param request GetUploadAudioDataParamsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetUploadAudioDataParamsResponse
 */
async function getUploadAudioDataParamsWithOptions(request: GetUploadAudioDataParamsRequest, runtime: $RuntimeOptions): GetUploadAudioDataParamsResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetUploadAudioDataParams',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取质检参数
 *
 * @param request GetUploadAudioDataParamsRequest
 * @return GetUploadAudioDataParamsResponse
 */
async function getUploadAudioDataParams(request: GetUploadAudioDataParamsRequest): GetUploadAudioDataParamsResponse {
  var runtime = new $RuntimeOptions{};
  return getUploadAudioDataParamsWithOptions(request, runtime);
}

model GetUserRequest {
  extension?: string(name='Extension', example='8003****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model GetUserResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    avatarUrl?: string(name='AvatarUrl'),
    deviceExt?: string(name='DeviceExt', example='8033****'),
    deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
    deviceState?: string(name='DeviceState', example='OFFLINE'),
    displayId?: string(name='DisplayId', example='1001'),
    displayName?: string(name='DisplayName'),
    email?: string(name='Email', example='username@example.com'),
    extension?: string(name='Extension', example='8003****'),
    instanceId?: string(name='InstanceId', example='ccc-test'),
    loginName?: string(name='LoginName', example='agent'),
    mobile?: string(name='Mobile', example='1391234****'),
    nickname?: string(name='Nickname'),
    roleId?: string(name='RoleId', example='Admin@ccc-test'),
    roleName?: string(name='RoleName', example='Admin'),
    userId?: string(name='UserId', example='agent@ccc-test'),
    workMode?: string(name='WorkMode', example='ON_SITE'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model GetUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUserResponseBody(name='body'),
}

/**
 * @param request GetUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetUserResponse
 */
async function getUserWithOptions(request: GetUserRequest, runtime: $RuntimeOptions): GetUserResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.extension)) {
    query['Extension'] = request.extension;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetUser',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetUserRequest
 * @return GetUserResponse
 */
async function getUser(request: GetUserRequest): GetUserResponse {
  var runtime = new $RuntimeOptions{};
  return getUserWithOptions(request, runtime);
}

model GetVideoRequest {
  contactId?: string(name='ContactId', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
}

model GetVideoResponseBody = {
  code?: string(name='Code'),
  data?: {
    fileName?: string(name='FileName'),
    fileUrl?: string(name='FileUrl'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model GetVideoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetVideoResponseBody(name='body'),
}

/**
 * @summary 获取视频
 *
 * @param request GetVideoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetVideoResponse
 */
async function getVideoWithOptions(request: GetVideoRequest, runtime: $RuntimeOptions): GetVideoResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetVideo',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取视频
 *
 * @param request GetVideoRequest
 * @return GetVideoResponse
 */
async function getVideo(request: GetVideoRequest): GetVideoResponse {
  var runtime = new $RuntimeOptions{};
  return getVideoWithOptions(request, runtime);
}

model GetVisitorLoginDetailsRequest {
  chatDeviceId?: string(name='ChatDeviceId', description='This parameter is required.', example='4c51c9116c36537cb850dc1081d745df'),
  instanceId?: string(name='InstanceId', example='ccc-test'),
  token?: string(name='Token', example='9XYGTGWtq2wFi_Bpg7aUnIoYi_vG_rO3b***YtsxbHRHrYHlz1LDBLJAyZcLxieRQR4h_6AnWvTjJeNU5jgxzO*****bHwej7WgWrmA'),
  visitorId?: string(name='VisitorId', description='This parameter is required.', example='fcd020fe-d8e4-40e5-8c77-1a272a174a7d'),
}

model GetVisitorLoginDetailsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    chatAppId?: string(name='ChatAppId', example='7pjxxx'),
    chatAppKey?: string(name='ChatAppKey', example='955e4bd7xxxxxxxxxxxxxd7898ba9fa0d0'),
    chatDeviceId?: string(name='ChatDeviceId', example='4c51c9116c36537cb850dc1081d745df'),
    chatLoginToken?: string(name='ChatLoginToken', example='{"accessToken":"oauth_cloud_key:+4oJXUAFSWxGD2YuRW4V/oUN0/8qJGNc0I*********n1E3DOr3Q3lX00ZnTpyqRi8Y6hYoLYA7n2ZkWuv485hVtXeSgnIQkKxXPbMgwoLxWaK//lI5Dn/mb4YuDifigv+ZyFzc+07vxm9ZFu/NjA==","accessTokenExpiredTime":86400000,"refreshToken":"oauth_cloud_key:/U+8UueDmpeUszhXC+SWow4pNLZp2C***********U/377BNXF+Mjo1lFgDk6GtEjNNoJpapX2mHH8GcRke2+yKQs/w4gAN9xSMn543Ciung+93pXV6IpQGbEVlu"}'),
    chatServerUrl?: string(name='ChatServerUrl', example='wss://wss.im.dingtalk.cn'),
    chatUserId?: string(name='ChatUserId', example='dac9c001****a15684ea91a81317'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='19D09CCC-F298-4124-849A-AFA217819011'),
}

model GetVisitorLoginDetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetVisitorLoginDetailsResponseBody(name='body'),
}

/**
 * @param request GetVisitorLoginDetailsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetVisitorLoginDetailsResponse
 */
async function getVisitorLoginDetailsWithOptions(request: GetVisitorLoginDetailsRequest, runtime: $RuntimeOptions): GetVisitorLoginDetailsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.chatDeviceId)) {
    query['ChatDeviceId'] = request.chatDeviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.token)) {
    query['Token'] = request.token;
  }
  if (!$isNull(request.visitorId)) {
    query['VisitorId'] = request.visitorId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetVisitorLoginDetails',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetVisitorLoginDetailsRequest
 * @return GetVisitorLoginDetailsResponse
 */
async function getVisitorLoginDetails(request: GetVisitorLoginDetailsRequest): GetVisitorLoginDetailsResponse {
  var runtime = new $RuntimeOptions{};
  return getVisitorLoginDetailsWithOptions(request, runtime);
}

model GetVoicemailRecordingRequest {
  contactId?: string(name='ContactId', description='This parameter is required.', example='job-12515239414412****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model GetVoicemailRecordingResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    fileName?: string(name='FileName', example='voicemail.job-054ded02****.wav'),
    fileUrl?: string(name='FileUrl', example='https://ccc-v2-online.oss-cn-shanghai.aliyuncs.com/ccc-record-mixed/ccc-test/2022/06/voicemail.job-054ded02****.wav?Expires=1656074923&OSSAccessKeyId=****&Signature=****'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model GetVoicemailRecordingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetVoicemailRecordingResponseBody(name='body'),
}

/**
 * @param request GetVoicemailRecordingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetVoicemailRecordingResponse
 */
async function getVoicemailRecordingWithOptions(request: GetVoicemailRecordingRequest, runtime: $RuntimeOptions): GetVoicemailRecordingResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactId)) {
    query['ContactId'] = request.contactId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetVoicemailRecording',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetVoicemailRecordingRequest
 * @return GetVoicemailRecordingResponse
 */
async function getVoicemailRecording(request: GetVoicemailRecordingRequest): GetVoicemailRecordingResponse {
  var runtime = new $RuntimeOptions{};
  return getVoicemailRecordingWithOptions(request, runtime);
}

model HoldCallRequest {
  channelId?: string(name='ChannelId', description='This parameter is required.', example='ch:customer:010123****->1318888****:1609255715825:job-6582589278232****'),
  deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-6582589278232****'),
  music?: string(name='Music'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model HoldCallResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-653821410368****'),
          channelState?: string(name='ChannelState', example='ANSWERED'),
          destination?: string(name='Destination', example='8001****'),
          jobId?: string(name='JobId', example='job-6582589278232****'),
          originator?: string(name='Originator', example='1318888****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
          timestamp?: long(name='Timestamp', example='1609255716900'),
          userExtension?: string(name='UserExtension', example='8001****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6582589278232****'),
    }(name='CallContext'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8001****'),
      heartbeat?: long(name='Heartbeat', example='1609255716908'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6582589278232****'),
      mobile?: string(name='Mobile', example='1390000****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1609255715822'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='174F7777-2F6C-4F10-B889-C698E26C1AE0'),
}

model HoldCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: HoldCallResponseBody(name='body'),
}

/**
 * @param request HoldCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return HoldCallResponse
 */
async function holdCallWithOptions(request: HoldCallRequest, runtime: $RuntimeOptions): HoldCallResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.channelId)) {
    query['ChannelId'] = request.channelId;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.music)) {
    query['Music'] = request.music;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'HoldCall',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request HoldCallRequest
 * @return HoldCallResponse
 */
async function holdCall(request: HoldCallRequest): HoldCallResponse {
  var runtime = new $RuntimeOptions{};
  return holdCallWithOptions(request, runtime);
}

model ImportAdminsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  ramIdList?: string(name='RamIdList', description='This parameter is required.', example='["26972543893791****"]'),
}

model ImportAdminsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      extension?: string(name='Extension', example='8021****'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      ramId?: string(name='RamId', example='26972543893791****'),
      roleId?: string(name='RoleId', example='Admin@ccc-test'),
      userId?: string(name='UserId', example='agent@ccc-test'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='1CDB5C94-ACFB-59B5-85FE-C1DAF8049C63'),
}

model ImportAdminsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ImportAdminsResponseBody(name='body'),
}

/**
 * @param request ImportAdminsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ImportAdminsResponse
 */
async function importAdminsWithOptions(request: ImportAdminsRequest, runtime: $RuntimeOptions): ImportAdminsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ramIdList)) {
    query['RamIdList'] = request.ramIdList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ImportAdmins',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ImportAdminsRequest
 * @return ImportAdminsResponse
 */
async function importAdmins(request: ImportAdminsRequest): ImportAdminsResponse {
  var runtime = new $RuntimeOptions{};
  return importAdminsWithOptions(request, runtime);
}

model ImportContactFlowRequest {
  flowPackageData?: string(name='FlowPackageData', description='This parameter is required.', example='{}'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='9cfad875-6260-4a53-ab6e-b13e3fb31f7d'),
  requestId?: string(name='RequestId', example='DE803553-8AA9-4B9D-9E4E-A82BC69EDCEE'),
}

model ImportContactFlowResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='27DD30C4-CAE2-481A-97CC-D3C54625341D'),
}

model ImportContactFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ImportContactFlowResponseBody(name='body'),
}

/**
 * @param request ImportContactFlowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ImportContactFlowResponse
 */
async function importContactFlowWithOptions(request: ImportContactFlowRequest, runtime: $RuntimeOptions): ImportContactFlowResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.flowPackageData)) {
    body['FlowPackageData'] = request.flowPackageData;
  }
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ImportContactFlow',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ImportContactFlowRequest
 * @return ImportContactFlowResponse
 */
async function importContactFlow(request: ImportContactFlowRequest): ImportContactFlowResponse {
  var runtime = new $RuntimeOptions{};
  return importContactFlowWithOptions(request, runtime);
}

model ImportCorpNumbersRequest {
  city?: string(name='City'),
  corpName?: string(name='CorpName'),
  numberList?: string(name='NumberList', description='This parameter is required.', example='[\\\\"02912345678\\\\"]'),
  provider?: string(name='Provider', description='This parameter is required.'),
  province?: string(name='Province'),
  tagList?: string(name='TagList'),
}

model ImportCorpNumbersResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='C42981C7-93D9-55CD-B078-784F8522E0E1'),
}

model ImportCorpNumbersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ImportCorpNumbersResponseBody(name='body'),
}

/**
 * @param request ImportCorpNumbersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ImportCorpNumbersResponse
 */
async function importCorpNumbersWithOptions(request: ImportCorpNumbersRequest, runtime: $RuntimeOptions): ImportCorpNumbersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.city)) {
    query['City'] = request.city;
  }
  if (!$isNull(request.corpName)) {
    query['CorpName'] = request.corpName;
  }
  if (!$isNull(request.numberList)) {
    query['NumberList'] = request.numberList;
  }
  if (!$isNull(request.provider)) {
    query['Provider'] = request.provider;
  }
  if (!$isNull(request.province)) {
    query['Province'] = request.province;
  }
  if (!$isNull(request.tagList)) {
    query['TagList'] = request.tagList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ImportCorpNumbers',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ImportCorpNumbersRequest
 * @return ImportCorpNumbersResponse
 */
async function importCorpNumbers(request: ImportCorpNumbersRequest): ImportCorpNumbersResponse {
  var runtime = new $RuntimeOptions{};
  return importCorpNumbersWithOptions(request, runtime);
}

model ImportCustomCallTaggingRequest {
  filePath?: string(name='FilePath', description='This parameter is required.', example='temp/ImportCustomCallTagging.xlsx'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model ImportCustomCallTaggingResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      item?: string(name='Item', example='1312121****'),
      reason?: string(name='Reason', example='CUSTOM_NUMBER_DUPLICATED'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model ImportCustomCallTaggingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ImportCustomCallTaggingResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI ImportCustomCallTagging is deprecated, please use CCC::2020-07-01::ImportCustomCallTaggings instead.
 *
 * @summary 文件导入呼入控制号码
 *
 * @param request ImportCustomCallTaggingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ImportCustomCallTaggingResponse
 */
// Deprecated
async function importCustomCallTaggingWithOptions(request: ImportCustomCallTaggingRequest, runtime: $RuntimeOptions): ImportCustomCallTaggingResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.filePath)) {
    query['FilePath'] = request.filePath;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ImportCustomCallTagging',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @deprecated OpenAPI ImportCustomCallTagging is deprecated, please use CCC::2020-07-01::ImportCustomCallTaggings instead.
 *
 * @summary 文件导入呼入控制号码
 *
 * @param request ImportCustomCallTaggingRequest
 * @return ImportCustomCallTaggingResponse
 */
// Deprecated
async function importCustomCallTagging(request: ImportCustomCallTaggingRequest): ImportCustomCallTaggingResponse {
  var runtime = new $RuntimeOptions{};
  return importCustomCallTaggingWithOptions(request, runtime);
}

model ImportDoNotCallNumbersRequest {
  filePath?: string(name='FilePath', example='temp/blacklist/import/15772471154xxxx/ccc-test/20220315100340/blacklist.xlsx'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  numberList?: string(name='NumberList', example='["1900000****","1312121****"]'),
  remark?: string(name='Remark'),
}

model ImportDoNotCallNumbersResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model ImportDoNotCallNumbersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ImportDoNotCallNumbersResponseBody(name='body'),
}

/**
 * @summary 添加黑名单号码
 *
 * @param request ImportDoNotCallNumbersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ImportDoNotCallNumbersResponse
 */
async function importDoNotCallNumbersWithOptions(request: ImportDoNotCallNumbersRequest, runtime: $RuntimeOptions): ImportDoNotCallNumbersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.filePath)) {
    query['FilePath'] = request.filePath;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.numberList)) {
    query['NumberList'] = request.numberList;
  }
  if (!$isNull(request.remark)) {
    query['Remark'] = request.remark;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ImportDoNotCallNumbers',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 添加黑名单号码
 *
 * @param request ImportDoNotCallNumbersRequest
 * @return ImportDoNotCallNumbersResponse
 */
async function importDoNotCallNumbers(request: ImportDoNotCallNumbersRequest): ImportDoNotCallNumbersResponse {
  var runtime = new $RuntimeOptions{};
  return importDoNotCallNumbersWithOptions(request, runtime);
}

model ImportDocumentsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='b0eb2742-f37e-4c67-82d4-25c651c1c450'),
  ossFileKey?: string(name='OssFileKey', description='This parameter is required.', example='ccc-test/test-file.wav'),
  requestId?: string(name='RequestId', example='7BEEA660-A45A-45E3-98CC-AFC65E715C23'),
  schemaId?: string(name='SchemaId', description='schema id

This parameter is required.', example='profile'),
}

model ImportDocumentsResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='01B12EE4-6AF2-4730-8B78-EC15F4E5C025'),
}

model ImportDocumentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ImportDocumentsResponseBody(name='body'),
}

/**
 * @param request ImportDocumentsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ImportDocumentsResponse
 */
async function importDocumentsWithOptions(request: ImportDocumentsRequest, runtime: $RuntimeOptions): ImportDocumentsResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ossFileKey)) {
    body['OssFileKey'] = request.ossFileKey;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  if (!$isNull(request.schemaId)) {
    body['SchemaId'] = request.schemaId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ImportDocuments',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ImportDocumentsRequest
 * @return ImportDocumentsResponse
 */
async function importDocuments(request: ImportDocumentsRequest): ImportDocumentsResponse {
  var runtime = new $RuntimeOptions{};
  return importDocumentsWithOptions(request, runtime);
}

model InitiateAttendedTransferRequest {
  callPriority?: int32(name='CallPriority'),
  deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-6538214103685****'),
  queuingOverflowThreshold?: long(name='QueuingOverflowThreshold'),
  queuingTimeoutSeconds?: long(name='QueuingTimeoutSeconds'),
  routingType?: string(name='RoutingType'),
  strategyName?: string(name='StrategyName'),
  strategyParams?: string(name='StrategyParams'),
  tags?: string(name='Tags'),
  timeoutSeconds?: int32(name='TimeoutSeconds', example='60'),
  transferee?: string(name='Transferee', description='This parameter is required.', example='agent2@ccc-test'),
  transfereeType?: string(name='TransfereeType'),
  transferor?: string(name='Transferor'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model InitiateAttendedTransferResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelFlags?: string(name='ChannelFlags', example='MONITORING'),
          channelId?: string(name='ChannelId', example='ch:user:139xxxx0501->80326034:1609138902226:job-6538214103685****'),
          channelState?: string(name='ChannelState', example='ANSWERED'),
          destination?: string(name='Destination', example='1390501****'),
          index?: int32(name='Index', example='10'),
          jobId?: string(name='JobId', example='job-6538214103685****'),
          originator?: string(name='Originator', example='0830019****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
          timestamp?: long(name='Timestamp', example='1609138903315'),
          userExtension?: string(name='UserExtension', example='8032****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    contextId?: long(name='ContextId', example='103655'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8032****'),
      heartbeat?: long(name='Heartbeat', example='1609136956378'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
      mobile?: string(name='Mobile', example='1324730****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1609136956378'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model InitiateAttendedTransferResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InitiateAttendedTransferResponseBody(name='body'),
}

/**
 * @param request InitiateAttendedTransferRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return InitiateAttendedTransferResponse
 */
async function initiateAttendedTransferWithOptions(request: InitiateAttendedTransferRequest, runtime: $RuntimeOptions): InitiateAttendedTransferResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.callPriority)) {
    query['CallPriority'] = request.callPriority;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.queuingOverflowThreshold)) {
    query['QueuingOverflowThreshold'] = request.queuingOverflowThreshold;
  }
  if (!$isNull(request.queuingTimeoutSeconds)) {
    query['QueuingTimeoutSeconds'] = request.queuingTimeoutSeconds;
  }
  if (!$isNull(request.routingType)) {
    query['RoutingType'] = request.routingType;
  }
  if (!$isNull(request.strategyName)) {
    query['StrategyName'] = request.strategyName;
  }
  if (!$isNull(request.strategyParams)) {
    query['StrategyParams'] = request.strategyParams;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!$isNull(request.timeoutSeconds)) {
    query['TimeoutSeconds'] = request.timeoutSeconds;
  }
  if (!$isNull(request.transferee)) {
    query['Transferee'] = request.transferee;
  }
  if (!$isNull(request.transfereeType)) {
    query['TransfereeType'] = request.transfereeType;
  }
  if (!$isNull(request.transferor)) {
    query['Transferor'] = request.transferor;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'InitiateAttendedTransfer',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request InitiateAttendedTransferRequest
 * @return InitiateAttendedTransferResponse
 */
async function initiateAttendedTransfer(request: InitiateAttendedTransferRequest): InitiateAttendedTransferResponse {
  var runtime = new $RuntimeOptions{};
  return initiateAttendedTransferWithOptions(request, runtime);
}

model InterceptCallRequest {
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  interceptedUserId?: string(name='InterceptedUserId', description='This parameter is required.', example='agent2@ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-6538214103685****'),
  timeoutSeconds?: int32(name='TimeoutSeconds', example='60'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model InterceptCallResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='INTERCEPT'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='INTERCEPT'),
          channelFlags?: string(name='ChannelFlags'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-653821410368****'),
          channelState?: string(name='ChannelState', example='ANSWERED'),
          destination?: string(name='Destination', example='1390501****'),
          index?: int32(name='Index', example='10'),
          jobId?: string(name='JobId', example='job-6538214103685****'),
          originator?: string(name='Originator', example='0830019****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
          timestamp?: long(name='Timestamp', example='1609138903315'),
          userExtension?: string(name='UserExtension', example='8032****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8032****'),
      heartbeat?: long(name='Heartbeat', example='1609136956378'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
      mobile?: string(name='Mobile', example='1324730****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1609136956378'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model InterceptCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InterceptCallResponseBody(name='body'),
}

/**
 * @param request InterceptCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return InterceptCallResponse
 */
async function interceptCallWithOptions(request: InterceptCallRequest, runtime: $RuntimeOptions): InterceptCallResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.interceptedUserId)) {
    query['InterceptedUserId'] = request.interceptedUserId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.timeoutSeconds)) {
    query['TimeoutSeconds'] = request.timeoutSeconds;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'InterceptCall',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request InterceptCallRequest
 * @return InterceptCallResponse
 */
async function interceptCall(request: InterceptCallRequest): InterceptCallResponse {
  var runtime = new $RuntimeOptions{};
  return interceptCallWithOptions(request, runtime);
}

model LaunchAuthenticationRequest {
  contactFlowId?: string(name='ContactFlowId', description='This parameter is required.', example='af145gfc-1108-4d55-8fca-f719bd512ebb'),
  contactFlowVariables?: string(name='ContactFlowVariables'),
  deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-6538214103685****'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model LaunchAuthenticationResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelFlags?: string(name='ChannelFlags', example='MONITORING'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-653821410368****'),
          channelState?: string(name='ChannelState', example='ANSWERED'),
          destination?: string(name='Destination', example='1390501****'),
          index?: int32(name='Index', example='10'),
          jobId?: string(name='JobId', example='job-6538214103685****'),
          originator?: string(name='Originator', example='0830019****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
          timestamp?: long(name='Timestamp', example='1609138903315'),
          userExtension?: string(name='UserExtension', example='8032****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8032****'),
      heartbeat?: long(name='Heartbeat', example='1609136956378'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
      mobile?: string(name='Mobile', example='1324730****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1609136956378'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model LaunchAuthenticationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LaunchAuthenticationResponseBody(name='body'),
}

/**
 * @param request LaunchAuthenticationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return LaunchAuthenticationResponse
 */
async function launchAuthenticationWithOptions(request: LaunchAuthenticationRequest, runtime: $RuntimeOptions): LaunchAuthenticationResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactFlowId)) {
    query['ContactFlowId'] = request.contactFlowId;
  }
  if (!$isNull(request.contactFlowVariables)) {
    query['ContactFlowVariables'] = request.contactFlowVariables;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'LaunchAuthentication',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request LaunchAuthenticationRequest
 * @return LaunchAuthenticationResponse
 */
async function launchAuthentication(request: LaunchAuthenticationRequest): LaunchAuthenticationResponse {
  var runtime = new $RuntimeOptions{};
  return launchAuthenticationWithOptions(request, runtime);
}

model LaunchSurveyRequest {
  contactFlowId?: string(name='ContactFlowId', example='4685b65a-eb8f-11ec-8ea0-0242ac120002'),
  contactFlowVariables?: string(name='ContactFlowVariables'),
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-6580466654649****'),
  smsMetadataId?: string(name='SmsMetadataId', example='4685b65a-eb8f-11ec-8ea0-0242ac120002'),
  surveyChannel?: string(name='SurveyChannel', example='IVR'),
  surveyTemplateId?: string(name='SurveyTemplateId'),
  surveyTemplateVariables?: string(name='SurveyTemplateVariables'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model LaunchSurveyResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelFlags?: string(name='ChannelFlags', example='MONITORING'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-653821410368****'),
          channelState?: string(name='ChannelState', example='ANSWERED'),
          destination?: string(name='Destination', example='1318888****'),
          index?: int32(name='Index', example='1'),
          jobId?: string(name='JobId', example='job-6580466654649****'),
          originator?: string(name='Originator', example='1318888****'),
          releaseInitiator?: string(name='ReleaseInitiator'),
          releaseReason?: string(name='ReleaseReason'),
          skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
          timestamp?: long(name='Timestamp', example='1609250655922'),
          userExtension?: string(name='UserExtension', example='8001****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6580466654649****'),
    }(name='CallContext'),
    contextId?: long(name='ContextId', example='102323'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8001****'),
      heartbeat?: long(name='Heartbeat', example='1609250656122'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6580466654649****'),
      mobile?: string(name='Mobile', example='1390000****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1609250655090'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='AF1E5957-5276-48FF-A6E6-347166A4ADCD'),
}

model LaunchSurveyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LaunchSurveyResponseBody(name='body'),
}

/**
 * @param request LaunchSurveyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return LaunchSurveyResponse
 */
async function launchSurveyWithOptions(request: LaunchSurveyRequest, runtime: $RuntimeOptions): LaunchSurveyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactFlowId)) {
    query['ContactFlowId'] = request.contactFlowId;
  }
  if (!$isNull(request.contactFlowVariables)) {
    query['ContactFlowVariables'] = request.contactFlowVariables;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.smsMetadataId)) {
    query['SmsMetadataId'] = request.smsMetadataId;
  }
  if (!$isNull(request.surveyChannel)) {
    query['SurveyChannel'] = request.surveyChannel;
  }
  if (!$isNull(request.surveyTemplateId)) {
    query['SurveyTemplateId'] = request.surveyTemplateId;
  }
  if (!$isNull(request.surveyTemplateVariables)) {
    query['SurveyTemplateVariables'] = request.surveyTemplateVariables;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'LaunchSurvey',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request LaunchSurveyRequest
 * @return LaunchSurveyResponse
 */
async function launchSurvey(request: LaunchSurveyRequest): LaunchSurveyResponse {
  var runtime = new $RuntimeOptions{};
  return launchSurveyWithOptions(request, runtime);
}

model ListAgentStateLogsRequest {
  agentId?: string(name='AgentId', description='This parameter is required.', example='agent@ccc-test'),
  endTime?: long(name='EndTime', example='1620273600000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  startTime?: long(name='StartTime', example='1620230400000'),
}

model ListAgentStateLogsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      breakCode?: string(name='BreakCode'),
      duration?: long(name='Duration'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      startTime?: long(name='StartTime', example='1620259200000'),
      state?: string(name='State', example='Break'),
      stateCode?: string(name='StateCode', example='CHECK_IN_BREAK'),
      workMode?: string(name='WorkMode'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='943D8EF3-3321-471F-A104-51C96FCA94D6'),
}

model ListAgentStateLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAgentStateLogsResponseBody(name='body'),
}

/**
 * @param request ListAgentStateLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAgentStateLogsResponse
 */
async function listAgentStateLogsWithOptions(request: ListAgentStateLogsRequest, runtime: $RuntimeOptions): ListAgentStateLogsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentId)) {
    query['AgentId'] = request.agentId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAgentStateLogs',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListAgentStateLogsRequest
 * @return ListAgentStateLogsResponse
 */
async function listAgentStateLogs(request: ListAgentStateLogsRequest): ListAgentStateLogsResponse {
  var runtime = new $RuntimeOptions{};
  return listAgentStateLogsWithOptions(request, runtime);
}

model ListAgentStatesRequest {
  agentIds?: string(name='AgentIds', example='agent@ccc-test'),
  excludeOfflineUsers?: boolean(name='ExcludeOfflineUsers', example='true', nullable=true),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='100'),
  skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
  state?: string(name='State', example='Ready'),
}

model ListAgentStatesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        agentId?: string(name='AgentId', example='agent@ccc-test'),
        agentName?: string(name='AgentName'),
        breakCode?: string(name='BreakCode', example='Warm-up'),
        dn?: string(name='Dn', example='8030****'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        loginName?: string(name='LoginName', example='agent'),
        outboundScenario?: boolean(name='OutboundScenario', example='false'),
        state?: string(name='State', example='Ready'),
        stateDuration?: string(name='StateDuration', example='10'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='100'),
    totalCount?: int32(name='TotalCount', example='11'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='03C67DAD-EB26-41D8-949D-9B0C470FB716'),
  success?: boolean(name='Success', example='true'),
}

model ListAgentStatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAgentStatesResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI ListAgentStates is deprecated, please use CCC::2020-07-01::ListRealtimeAgentStates instead.
 *
 * @summary ListAgentStates for ACC
 *
 * @param request ListAgentStatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAgentStatesResponse
 */
// Deprecated
async function listAgentStatesWithOptions(request: ListAgentStatesRequest, runtime: $RuntimeOptions): ListAgentStatesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentIds)) {
    query['AgentIds'] = request.agentIds;
  }
  if (!$isNull(request.excludeOfflineUsers)) {
    query['ExcludeOfflineUsers'] = request.excludeOfflineUsers;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  if (!$isNull(request.state)) {
    query['State'] = request.state;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAgentStates',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @deprecated OpenAPI ListAgentStates is deprecated, please use CCC::2020-07-01::ListRealtimeAgentStates instead.
 *
 * @summary ListAgentStates for ACC
 *
 * @param request ListAgentStatesRequest
 * @return ListAgentStatesResponse
 */
// Deprecated
async function listAgentStates(request: ListAgentStatesRequest): ListAgentStatesResponse {
  var runtime = new $RuntimeOptions{};
  return listAgentStatesWithOptions(request, runtime);
}

model ListAgentSummaryReportsSinceMidnightRequest {
  agentIds?: string(name='AgentIds', example='["agent1@ccc-test", "agent2@ccc-test"]'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
}

model ListAgentSummaryReportsSinceMidnightResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  pagedAgentSummaryReport?: {
    list?: [ 
      {
        agentId?: string(name='AgentId', example='agent@ccc-test'),
        agentName?: string(name='AgentName'),
        inbound?: {
          averageRingTime?: long(name='AverageRingTime', example='0'),
          averageTalkTime?: long(name='AverageTalkTime', example='0'),
          averageWorkTime?: long(name='AverageWorkTime', example='0'),
          callsHandled?: long(name='CallsHandled', example='0'),
          callsOffered?: long(name='CallsOffered', example='0'),
          handleRate?: float(name='HandleRate', example='0'),
          maxRingTime?: long(name='MaxRingTime', example='0'),
          maxTalkTime?: long(name='MaxTalkTime', example='0'),
          maxWorkTime?: long(name='MaxWorkTime', example='0'),
          satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
          satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
          satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
          serviceLevel20?: float(name='ServiceLevel20', example='0'),
          totalRingTime?: long(name='TotalRingTime', example='0'),
          totalTalkTime?: long(name='TotalTalkTime', example='0'),
          totalWorkTime?: long(name='TotalWorkTime', example='0'),
        }(name='Inbound'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        loginName?: string(name='LoginName', example='agent'),
        outbound?: {
          answerRate?: float(name='AnswerRate', example='0'),
          averageDialingTime?: long(name='AverageDialingTime', example='0'),
          averageTalkTime?: long(name='AverageTalkTime', example='0'),
          averageWorkTime?: long(name='AverageWorkTime', example='0'),
          callsAnswered?: long(name='CallsAnswered', example='0'),
          callsDialed?: long(name='CallsDialed', example='0'),
          maxDialingTime?: long(name='MaxDialingTime', example='0'),
          maxTalkTime?: long(name='MaxTalkTime', example='0'),
          maxWorkTime?: string(name='MaxWorkTime', example='0'),
          satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
          satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
          satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
          totalDialingTime?: long(name='TotalDialingTime', example='0'),
          totalTalkTime?: long(name='TotalTalkTime', example='0'),
          totalWorkTime?: long(name='TotalWorkTime', example='0'),
        }(name='Outbound'),
        overall?: {
          averageReadyTime?: long(name='AverageReadyTime', example='0'),
          averageTalkTime?: long(name='AverageTalkTime', example='0'),
          averageWorkTime?: long(name='AverageWorkTime', example='0'),
          maxReadyTime?: long(name='MaxReadyTime', example='37'),
          maxTalkTime?: long(name='MaxTalkTime', example='0'),
          maxWorkTime?: long(name='MaxWorkTime', example='0'),
          occupancyRate?: float(name='OccupancyRate', example='0'),
          oneTransferCalls?: long(name='OneTransferCalls', example='0'),
          satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
          satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
          satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
          totalBreakTime?: long(name='TotalBreakTime', example='0'),
          totalCalls?: long(name='TotalCalls', example='0'),
          totalLoggedInTime?: long(name='TotalLoggedInTime', example='0'),
          totalReadyTime?: long(name='TotalReadyTime', example='0'),
          totalTalkTime?: long(name='TotalTalkTime', example='0'),
          totalWorkTime?: long(name='TotalWorkTime', example='0'),
        }(name='Overall'),
        skillGroupIds?: string(name='SkillGroupIds', example='["skillgroup1@ccc-test","skillgroup2@ccc-test"]'),
        skillGroupNames?: string(name='SkillGroupNames'),
        timestamp?: string(name='Timestamp', example='2018-09-13 00:00:00'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='2'),
  }(name='PagedAgentSummaryReport'),
  requestId?: string(name='RequestId', example='27DD30C4-CAE2-481A-97CC-D3C54625341D'),
  success?: boolean(name='Success', example='true'),
}

model ListAgentSummaryReportsSinceMidnightResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAgentSummaryReportsSinceMidnightResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI ListAgentSummaryReportsSinceMidnight is deprecated, please use CCC::2020-07-01::ListHistoricalAgentReport instead.
 *
 * @summary ListAgentSummaryReportsSinceMidnight for acc
 *
 * @param request ListAgentSummaryReportsSinceMidnightRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAgentSummaryReportsSinceMidnightResponse
 */
// Deprecated
async function listAgentSummaryReportsSinceMidnightWithOptions(request: ListAgentSummaryReportsSinceMidnightRequest, runtime: $RuntimeOptions): ListAgentSummaryReportsSinceMidnightResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAgentSummaryReportsSinceMidnight',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @deprecated OpenAPI ListAgentSummaryReportsSinceMidnight is deprecated, please use CCC::2020-07-01::ListHistoricalAgentReport instead.
 *
 * @summary ListAgentSummaryReportsSinceMidnight for acc
 *
 * @param request ListAgentSummaryReportsSinceMidnightRequest
 * @return ListAgentSummaryReportsSinceMidnightResponse
 */
// Deprecated
async function listAgentSummaryReportsSinceMidnight(request: ListAgentSummaryReportsSinceMidnightRequest): ListAgentSummaryReportsSinceMidnightResponse {
  var runtime = new $RuntimeOptions{};
  return listAgentSummaryReportsSinceMidnightWithOptions(request, runtime);
}

model ListAttemptsRequest {
  agentId?: string(name='AgentId', example='agent@ccc-test'),
  attemptId?: string(name='AttemptId', example='job-16976964500325****'),
  callee?: string(name='Callee', example='1888888****'),
  caller?: string(name='Caller', example='05711234****'),
  campaignId?: string(name='CampaignId', description='This parameter is required.', example='6badb397-a8b5-40b6-21019d382a09'),
  caseId?: string(name='CaseId', description='This parameter is required.', example='60ecb1a2-4480-4d01-bede-c5b7655bfadf'),
  contactId?: string(name='ContactId', example='job-16976964500325****'),
  criteria?: string(name='Criteria'),
  endTime?: long(name='EndTime', example='1634115698291'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='100'),
  queueId?: string(name='QueueId', example='skillgroup@ccc-test'),
  startTime?: long(name='StartTime', example='1634115688291'),
}

model ListAttemptsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        agentEstablishedTime?: long(name='AgentEstablishedTime', example='1632883592732'),
        agentId?: string(name='AgentId', example='agent@ccc-test'),
        agentRingDuration?: long(name='AgentRingDuration', example='23'),
        assignAgentTime?: long(name='AssignAgentTime', example='1634196287869'),
        attemptId?: string(name='AttemptId', example='job-1704342174816****'),
        callee?: string(name='Callee', example='1888888****'),
        caller?: string(name='Caller', example='05711234****'),
        campaignId?: string(name='CampaignId', example='083046e3-5822-4cda-9b84-04f2a02eb605'),
        caseId?: string(name='CaseId', example='21d194a7-60b7-4824-932b-48ed03a83704'),
        contactId?: string(name='ContactId', example='job-1704342174816****'),
        customerEstablishedTime?: long(name='CustomerEstablishedTime', example='1634196286708'),
        customerReleasedTime?: long(name='CustomerReleasedTime', example='1634196317888'),
        dialDuration?: long(name='DialDuration', example='2734'),
        dialTime?: long(name='DialTime', example='1634196283974'),
        enqueueTime?: long(name='EnqueueTime', example='1634196287789'),
        enterIvrTime?: long(name='EnterIvrTime', example='1634196286740'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        ivrDuration?: long(name='IvrDuration', example='1049'),
        queueDuration?: long(name='QueueDuration', example='80'),
        queueId?: string(name='QueueId', example='skillgroup@ccc-test'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='100'),
    totalCount?: int32(name='TotalCount', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='7CC6523B-0E51-1B62-8DA5-6A9831CAE315'),
}

model ListAttemptsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAttemptsResponseBody(name='body'),
}

/**
 * @summary 获取预测式外呼呼叫记录
 *
 * @param request ListAttemptsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAttemptsResponse
 */
async function listAttemptsWithOptions(request: ListAttemptsRequest, runtime: $RuntimeOptions): ListAttemptsResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAttempts',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取预测式外呼呼叫记录
 *
 * @param request ListAttemptsRequest
 * @return ListAttemptsResponse
 */
async function listAttempts(request: ListAttemptsRequest): ListAttemptsResponse {
  var runtime = new $RuntimeOptions{};
  return listAttemptsWithOptions(request, runtime);
}

model ListAudioFilesRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  status?: string(name='Status'),
  usage?: string(name='Usage'),
}

model ListAudioFilesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        audioFileName?: string(name='AudioFileName', example='test-file.wav'),
        audioResourceId?: string(name='AudioResourceId', example='d5cd7a94-3b6a-47d2-b7fd-0b1cd839bf77'),
        auditResult?: string(name='AuditResult'),
        createdTime?: string(name='CreatedTime', example='2021-03-05 17:35:45.0'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        name?: string(name='Name'),
        ossFileKey?: string(name='OssFileKey', example='ccc-test/test-file.wav'),
        status?: string(name='Status'),
        updatedTime?: string(name='UpdatedTime', example='2021-03-08 15:34:49.0'),
        usage?: string(name='Usage'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='10'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='53223330-EBF1-586B-A2CB-93C3B711FDA0'),
}

model ListAudioFilesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAudioFilesResponseBody(name='body'),
}

/**
 * @summary 获取音频文件列表
 *
 * @param request ListAudioFilesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAudioFilesResponse
 */
async function listAudioFilesWithOptions(request: ListAudioFilesRequest, runtime: $RuntimeOptions): ListAudioFilesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  if (!$isNull(request.usage)) {
    query['Usage'] = request.usage;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAudioFiles',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取音频文件列表
 *
 * @param request ListAudioFilesRequest
 * @return ListAudioFilesResponse
 */
async function listAudioFiles(request: ListAudioFilesRequest): ListAudioFilesResponse {
  var runtime = new $RuntimeOptions{};
  return listAudioFilesWithOptions(request, runtime);
}

model ListBlacklistCallTaggingsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  numberList?: string(name='NumberList', description='This parameter is required.', example='[{"number":"1521083xxxx","jobId":"job-481841171213393920"}]'),
}

model ListBlacklistCallTaggingsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      blacklisted?: boolean(name='Blacklisted', example='true'),
      jobId?: string(name='JobId', example='job-481841171213393920'),
      number?: string(name='Number', example='1521083xxxx'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', description='Id of the request', example='032C73C4-3A6F-4502-872B-4F5B41161C6E'),
}

model ListBlacklistCallTaggingsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBlacklistCallTaggingsResponseBody(name='body'),
}

/**
 * @summary 编辑呼入控制号码
 *
 * @param request ListBlacklistCallTaggingsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListBlacklistCallTaggingsResponse
 */
async function listBlacklistCallTaggingsWithOptions(request: ListBlacklistCallTaggingsRequest, runtime: $RuntimeOptions): ListBlacklistCallTaggingsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.numberList)) {
    query['NumberList'] = request.numberList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListBlacklistCallTaggings',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 编辑呼入控制号码
 *
 * @param request ListBlacklistCallTaggingsRequest
 * @return ListBlacklistCallTaggingsResponse
 */
async function listBlacklistCallTaggings(request: ListBlacklistCallTaggingsRequest): ListBlacklistCallTaggingsResponse {
  var runtime = new $RuntimeOptions{};
  return listBlacklistCallTaggingsWithOptions(request, runtime);
}

model ListBriefSkillGroupsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  mediaType?: string(name='MediaType'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  searchPattern?: string(name='SearchPattern', example='skillgroup'),
}

model ListBriefSkillGroupsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        description?: string(name='Description'),
        displayName?: string(name='DisplayName'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        mediaType?: string(name='MediaType'),
        phoneNumberCount?: int32(name='PhoneNumberCount', example='1'),
        skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
        skillGroupName?: string(name='SkillGroupName', example='skillgroup'),
        userCount?: int32(name='UserCount', example='10'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='10'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='3969FC68-CEC2-4398-B76A-60D2F7EDEBAF'),
}

model ListBriefSkillGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBriefSkillGroupsResponseBody(name='body'),
}

/**
 * @param request ListBriefSkillGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListBriefSkillGroupsResponse
 */
async function listBriefSkillGroupsWithOptions(request: ListBriefSkillGroupsRequest, runtime: $RuntimeOptions): ListBriefSkillGroupsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.searchPattern)) {
    query['SearchPattern'] = request.searchPattern;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListBriefSkillGroups',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListBriefSkillGroupsRequest
 * @return ListBriefSkillGroupsResponse
 */
async function listBriefSkillGroups(request: ListBriefSkillGroupsRequest): ListBriefSkillGroupsResponse {
  var runtime = new $RuntimeOptions{};
  return listBriefSkillGroupsWithOptions(request, runtime);
}

model ListCallDetailRecordsRequest {
  agentId?: string(name='AgentId', example='agent@ccc-test'),
  calledNumber?: string(name='CalledNumber', example='1320523****'),
  callingNumber?: string(name='CallingNumber', example='07353988****'),
  contactDisposition?: string(name='ContactDisposition', example='Success'),
  contactDispositionList?: string(name='ContactDispositionList', example='["Success","NoAnswer"]'),
  contactId?: string(name='ContactId', example='job-12515239414412****'),
  contactType?: string(name='ContactType', example='Outbound'),
  contactTypeList?: string(name='ContactTypeList', example='["Internal","Inbound"]'),
  criteria?: string(name='Criteria', example='{"phoneNumber":"0735"}'),
  earlyMediaStateList?: string(name='EarlyMediaStateList', example='["NotConnected","NoAnswer"]'),
  endTime?: long(name='EndTime', example='1532707199000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  orderByField?: string(name='OrderByField', example='startTime'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='100'),
  satisfactionDescriptionList?: string(name='SatisfactionDescriptionList'),
  satisfactionList?: string(name='SatisfactionList', example='["1","3"]'),
  satisfactionSurveyChannel?: string(name='SatisfactionSurveyChannel', example='IVR'),
  skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
  sortOrder?: string(name='SortOrder', example='DESC'),
  startTime?: long(name='StartTime', example='1532448000000'),
}

model ListCallDetailRecordsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        additionalBroker?: string(name='AdditionalBroker', example='0533128****'),
        agentIds?: string(name='AgentIds', example='agent@ccc-test'),
        agentNames?: string(name='AgentNames'),
        broker?: string(name='Broker', example='0533127****'),
        callDuration?: string(name='CallDuration', example='30'),
        callIds?: string(name='CallIds'),
        calledNumber?: string(name='CalledNumber', example='1332315****'),
        calleeLocation?: string(name='CalleeLocation'),
        callerLocation?: string(name='CallerLocation'),
        callingNumber?: string(name='CallingNumber', example='0533128****'),
        contactDisposition?: string(name='ContactDisposition', example='Success'),
        contactId?: string(name='ContactId', example='job-12515239414412****'),
        contactType?: string(name='ContactType', example='Outbound'),
        dialingTime?: long(name='DialingTime'),
        earlyMediaState?: string(name='EarlyMediaState', example='NotConnected'),
        establishedTime?: long(name='EstablishedTime', example='1532448000000'),
        heldTime?: long(name='HeldTime'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        ivrTime?: long(name='IvrTime', example='8'),
        queueTime?: long(name='QueueTime', example='0'),
        recordingDuration?: long(name='RecordingDuration', example='10'),
        recordingReady?: boolean(name='RecordingReady', example='true'),
        releaseInitiator?: string(name='ReleaseInitiator', example='customer'),
        releaseReason?: string(name='ReleaseReason'),
        releaseTime?: long(name='ReleaseTime', example='1532707199000'),
        ringTime?: long(name='RingTime', example='5'),
        satisfactionDescription?: string(name='SatisfactionDescription'),
        satisfactionIndex?: int32(name='SatisfactionIndex', example='1'),
        satisfactionSurveyChannel?: string(name='SatisfactionSurveyChannel', example='IVR'),
        satisfactionSurveyOffered?: boolean(name='SatisfactionSurveyOffered', example='true'),
        skillGroupIds?: string(name='SkillGroupIds', example='skillgroup@ccc-test'),
        skillGroupNames?: string(name='SkillGroupNames'),
        startTime?: long(name='StartTime', example='1532448000000'),
        talkTime?: long(name='TalkTime'),
        waitTime?: long(name='WaitTime', example='5'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='11'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ListCallDetailRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCallDetailRecordsResponseBody(name='body'),
}

/**
 * @param request ListCallDetailRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCallDetailRecordsResponse
 */
async function listCallDetailRecordsWithOptions(request: ListCallDetailRecordsRequest, runtime: $RuntimeOptions): ListCallDetailRecordsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentId)) {
    query['AgentId'] = request.agentId;
  }
  if (!$isNull(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!$isNull(request.callingNumber)) {
    query['CallingNumber'] = request.callingNumber;
  }
  if (!$isNull(request.contactDisposition)) {
    query['ContactDisposition'] = request.contactDisposition;
  }
  if (!$isNull(request.contactDispositionList)) {
    query['ContactDispositionList'] = request.contactDispositionList;
  }
  if (!$isNull(request.contactId)) {
    query['ContactId'] = request.contactId;
  }
  if (!$isNull(request.contactType)) {
    query['ContactType'] = request.contactType;
  }
  if (!$isNull(request.contactTypeList)) {
    query['ContactTypeList'] = request.contactTypeList;
  }
  if (!$isNull(request.criteria)) {
    query['Criteria'] = request.criteria;
  }
  if (!$isNull(request.earlyMediaStateList)) {
    query['EarlyMediaStateList'] = request.earlyMediaStateList;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.orderByField)) {
    query['OrderByField'] = request.orderByField;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.satisfactionDescriptionList)) {
    query['SatisfactionDescriptionList'] = request.satisfactionDescriptionList;
  }
  if (!$isNull(request.satisfactionList)) {
    query['SatisfactionList'] = request.satisfactionList;
  }
  if (!$isNull(request.satisfactionSurveyChannel)) {
    query['SatisfactionSurveyChannel'] = request.satisfactionSurveyChannel;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  if (!$isNull(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCallDetailRecords',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListCallDetailRecordsRequest
 * @return ListCallDetailRecordsResponse
 */
async function listCallDetailRecords(request: ListCallDetailRecordsRequest): ListCallDetailRecordsResponse {
  var runtime = new $RuntimeOptions{};
  return listCallDetailRecordsWithOptions(request, runtime);
}

model ListCallDetailRecordsV2Request {
  accessChannelTypeList?: string(name='AccessChannelTypeList', example='["Web","AliMe"]'),
  agentId?: string(name='AgentId', example='agent@ccc-test'),
  analyticsReportReady?: boolean(name='AnalyticsReportReady'),
  broker?: string(name='Broker', example='021****4972'),
  calledNumber?: string(name='CalledNumber', example='191***9993'),
  callingNumber?: string(name='CallingNumber', example='191***9993'),
  contactDispositionList?: string(name='ContactDispositionList', example='["Success","NoAnswer"]'),
  contactIdList?: string(name='ContactIdList', example='["job-123456789","job-234567891"]'),
  contactTypeList?: string(name='ContactTypeList', example='["INBOUND","OUTBOUND"]'),
  earlyMediaStateList?: string(name='EarlyMediaStateList', example='["NotConnected","NoAnswer"]'),
  endTime?: long(name='EndTime', example='1657879880010'),
  firstAgentId?: string(name='FirstAgentId', example='agent@ccc-test'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  mediaType?: string(name='MediaType', example='AUDIO'),
  number?: string(name='Number', example='191***9993'),
  orderByField?: string(name='OrderByField', example='startTime'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='100'),
  releaseInitiatorList?: string(name='ReleaseInitiatorList'),
  releaseReasonList?: string(name='ReleaseReasonList'),
  satisfactionDescriptionList?: string(name='SatisfactionDescriptionList'),
  satisfactionRateList?: string(name='SatisfactionRateList', example='["1","3"]'),
  satisfactionSurveyChannel?: string(name='SatisfactionSurveyChannel', example='IVR'),
  searchPattern?: string(name='SearchPattern'),
  skillGroupIdList?: string(name='SkillGroupIdList', example='[
      "skg1@ccc-test",
      "skg2@ccc-test"
]'),
  sortOrder?: string(name='SortOrder', example='DESC'),
  startTime?: long(name='StartTime', example='1657853640015'),
}

model ListCallDetailRecordsV2ResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        accessChannelName?: string(name='AccessChannelName'),
        accessChannelType?: string(name='AccessChannelType', example='Web'),
        accessChannelUserId?: string(name='AccessChannelUserId', example='test-user-id'),
        accessChannelUserName?: string(name='AccessChannelUserName'),
        additionalBroker?: string(name='AdditionalBroker', example='0533128****'),
        agentIds?: string(name='AgentIds', example='agent@ccc-test'),
        agentNames?: string(name='AgentNames'),
        analyticsReport?: {
          emotion?: {
            confidence?: int32(name='Confidence'),
            remark?: string(name='Remark'),
            success?: boolean(name='Success'),
            taskId?: string(name='TaskId'),
            type?: string(name='Type'),
          }(name='Emotion'),
          problemSolving?: {
            problem?: string(name='Problem'),
            solution?: string(name='Solution'),
            solved?: boolean(name='Solved'),
            success?: boolean(name='Success'),
            taskId?: string(name='TaskId'),
          }(name='ProblemSolving'),
          satisfaction?: {
            remark?: string(name='Remark'),
            satisfactionDescription?: string(name='SatisfactionDescription'),
            success?: boolean(name='Success'),
            taskId?: string(name='TaskId'),
          }(name='Satisfaction'),
          todoList?: {
            success?: boolean(name='Success'),
            taskId?: string(name='TaskId'),
            tasks?: [ string ](name='Tasks'),
          }(name='TodoList'),
        }(name='AnalyticsReport'),
        analyticsReportReady?: boolean(name='AnalyticsReportReady'),
        broker?: string(name='Broker', example='053xxxx3127'),
        callDuration?: string(name='CallDuration', example='16'),
        callIds?: string(name='CallIds'),
        calledNumber?: string(name='CalledNumber', example='1332315****'),
        calleeLocation?: string(name='CalleeLocation'),
        callerLocation?: string(name='CallerLocation'),
        callingNumber?: string(name='CallingNumber', example='0533128****'),
        clientAppName?: string(name='ClientAppName'),
        clientIpAddress?: string(name='ClientIpAddress', example='10.100.2.1'),
        clientLocation?: string(name='ClientLocation', example='---'),
        clientUserAgent?: string(name='ClientUserAgent', example='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36'),
        contactDisposition?: string(name='ContactDisposition', example='Success'),
        contactId?: string(name='ContactId', example='job-2255019651513856'),
        contactType?: string(name='ContactType', example='OUTBOUND'),
        dialingTime?: long(name='DialingTime', example='0'),
        earlyMediaState?: string(name='EarlyMediaState', example='NotConnected'),
        earlyMediaText?: string(name='EarlyMediaText'),
        establishedTime?: long(name='EstablishedTime', example='1532448000000'),
        firstResponseTime?: long(name='FirstResponseTime', example='10'),
        heldTime?: long(name='HeldTime', example='12'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        ivrTime?: long(name='IvrTime', example='8'),
        mediaType?: string(name='MediaType', example='CHAT'),
        messagesSent?: long(name='MessagesSent', example='10'),
        messagesSentByAgent?: long(name='MessagesSentByAgent', example='5'),
        messagesSentByCustomer?: long(name='MessagesSentByCustomer', example='5'),
        offSiteAgentIds?: string(name='OffSiteAgentIds', example='skg-default@ccc-test'),
        offsiteAgentDestinationNumbers?: string(name='OffsiteAgentDestinationNumbers', example='80312348'),
        offsiteAgentOriginatorNumbers?: string(name='OffsiteAgentOriginatorNumbers', example='0101257****'),
        queueTime?: long(name='QueueTime', example='0'),
        recordingDuration?: long(name='RecordingDuration', example='10'),
        recordingReady?: boolean(name='RecordingReady', example='true'),
        releaseInitiator?: string(name='ReleaseInitiator', example='customer'),
        releaseReason?: string(name='ReleaseReason', example='486:USER_BUSY'),
        releaseTime?: long(name='ReleaseTime', example='1532707199000'),
        ringTime?: long(name='RingTime', example='5'),
        satisfactionDescription?: string(name='SatisfactionDescription'),
        satisfactionIndex?: int32(name='SatisfactionIndex', example='1'),
        satisfactionSurveyChannel?: string(name='SatisfactionSurveyChannel', example='IVR'),
        satisfactionSurveyOffered?: boolean(name='SatisfactionSurveyOffered', example='true'),
        skillGroupIds?: string(name='SkillGroupIds', example='skg-default@ccc-test'),
        skillGroupNames?: string(name='SkillGroupNames'),
        startTime?: long(name='StartTime', example='1631440860000'),
        talkTime?: long(name='TalkTime', example='0'),
        transferCount?: long(name='TransferCount', example='1'),
        waitTime?: long(name='WaitTime', example='5'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='100'),
    totalCount?: int32(name='TotalCount', example='10'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='01B12EE4-6AF2-4730-8B78-EC15F4E5C025'),
}

model ListCallDetailRecordsV2Response = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCallDetailRecordsV2ResponseBody(name='body'),
}

/**
 * @param request ListCallDetailRecordsV2Request
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCallDetailRecordsV2Response
 */
async function listCallDetailRecordsV2WithOptions(request: ListCallDetailRecordsV2Request, runtime: $RuntimeOptions): ListCallDetailRecordsV2Response {
  request.validate();
  var query = {};
  if (!$isNull(request.accessChannelTypeList)) {
    query['AccessChannelTypeList'] = request.accessChannelTypeList;
  }
  if (!$isNull(request.agentId)) {
    query['AgentId'] = request.agentId;
  }
  if (!$isNull(request.analyticsReportReady)) {
    query['AnalyticsReportReady'] = request.analyticsReportReady;
  }
  if (!$isNull(request.broker)) {
    query['Broker'] = request.broker;
  }
  if (!$isNull(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!$isNull(request.callingNumber)) {
    query['CallingNumber'] = request.callingNumber;
  }
  if (!$isNull(request.contactDispositionList)) {
    query['ContactDispositionList'] = request.contactDispositionList;
  }
  if (!$isNull(request.contactIdList)) {
    query['ContactIdList'] = request.contactIdList;
  }
  if (!$isNull(request.contactTypeList)) {
    query['ContactTypeList'] = request.contactTypeList;
  }
  if (!$isNull(request.earlyMediaStateList)) {
    query['EarlyMediaStateList'] = request.earlyMediaStateList;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.firstAgentId)) {
    query['FirstAgentId'] = request.firstAgentId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!$isNull(request.number)) {
    query['Number'] = request.number;
  }
  if (!$isNull(request.orderByField)) {
    query['OrderByField'] = request.orderByField;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.releaseInitiatorList)) {
    query['ReleaseInitiatorList'] = request.releaseInitiatorList;
  }
  if (!$isNull(request.releaseReasonList)) {
    query['ReleaseReasonList'] = request.releaseReasonList;
  }
  if (!$isNull(request.satisfactionDescriptionList)) {
    query['SatisfactionDescriptionList'] = request.satisfactionDescriptionList;
  }
  if (!$isNull(request.satisfactionRateList)) {
    query['SatisfactionRateList'] = request.satisfactionRateList;
  }
  if (!$isNull(request.satisfactionSurveyChannel)) {
    query['SatisfactionSurveyChannel'] = request.satisfactionSurveyChannel;
  }
  if (!$isNull(request.searchPattern)) {
    query['SearchPattern'] = request.searchPattern;
  }
  if (!$isNull(request.skillGroupIdList)) {
    query['SkillGroupIdList'] = request.skillGroupIdList;
  }
  if (!$isNull(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCallDetailRecordsV2',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListCallDetailRecordsV2Request
 * @return ListCallDetailRecordsV2Response
 */
async function listCallDetailRecordsV2(request: ListCallDetailRecordsV2Request): ListCallDetailRecordsV2Response {
  var runtime = new $RuntimeOptions{};
  return listCallDetailRecordsV2WithOptions(request, runtime);
}

model ListCallSummariesRequest {
  contactIdList?: [ string ](name='ContactIdList'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model ListCallSummariesShrinkRequest {
  contactIdListShrink?: string(name='ContactIdList'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model ListCallSummariesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      contactId?: string(name='ContactId', example='job-544789******759424'),
      context?: string(name='Context'),
      createdTime?: long(name='CreatedTime', example='1723449513735'),
      creator?: string(name='Creator', example='creator@ccc-test'),
      editor?: string(name='Editor', example='editor@ccc-test'),
      ticketId?: string(name='TicketId', example='ac0dd304-****-****-****-4a90010f0d38'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='932579BC-811A-503D-B322-4C2E57087CAA'),
}

model ListCallSummariesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCallSummariesResponseBody(name='body'),
}

/**
 * @param tmpReq ListCallSummariesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCallSummariesResponse
 */
async function listCallSummariesWithOptions(tmpReq: ListCallSummariesRequest, runtime: $RuntimeOptions): ListCallSummariesResponse {
  tmpReq.validate();
  var request = new ListCallSummariesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.contactIdList)) {
    request.contactIdListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.contactIdList, 'ContactIdList', 'json');
  }
  var query = {};
  if (!$isNull(request.contactIdListShrink)) {
    query['ContactIdList'] = request.contactIdListShrink;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCallSummaries',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListCallSummariesRequest
 * @return ListCallSummariesResponse
 */
async function listCallSummaries(request: ListCallSummariesRequest): ListCallSummariesResponse {
  var runtime = new $RuntimeOptions{};
  return listCallSummariesWithOptions(request, runtime);
}

model ListCallTagsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
}

model ListCallTagsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        instanceId?: string(name='InstanceId', example='ccc-test'),
        tagName?: string(name='TagName', example='TagA'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='10'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model ListCallTagsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCallTagsResponseBody(name='body'),
}

/**
 * @summary 列出号码标签
 *
 * @param request ListCallTagsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCallTagsResponse
 */
async function listCallTagsWithOptions(request: ListCallTagsRequest, runtime: $RuntimeOptions): ListCallTagsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCallTags',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 列出号码标签
 *
 * @param request ListCallTagsRequest
 * @return ListCallTagsResponse
 */
async function listCallTags(request: ListCallTagsRequest): ListCallTagsResponse {
  var runtime = new $RuntimeOptions{};
  return listCallTagsWithOptions(request, runtime);
}

model ListCampaignTrendingReportRequest {
  campaignId?: string(name='CampaignId', description='This parameter is required.', example='6badb397-a8b5-40b6-21019d382a09'),
  endTime?: long(name='EndTime', example='2021-10-14 20:59:59'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  startTime?: long(name='StartTime', example='2021-10-14 00:00:00'),
}

model ListCampaignTrendingReportResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      breakAgents?: long(name='BreakAgents', example='0'),
      breakingAgents?: long(name='BreakingAgents'),
      concurrency?: long(name='Concurrency', example='1'),
      datetime?: long(name='Datetime', example='1634037840000'),
      loggedInAgents?: long(name='LoggedInAgents', example='2'),
      outboundScenarioBreakingAgents?: long(name='OutboundScenarioBreakingAgents'),
      outboundScenarioReadyAgents?: long(name='OutboundScenarioReadyAgents'),
      outboundScenarioTalkingAgents?: long(name='OutboundScenarioTalkingAgents'),
      outboundScenarioWorkingAgents?: long(name='OutboundScenarioWorkingAgents'),
      readyAgents?: long(name='ReadyAgents', example='2'),
      statsTime?: long(name='StatsTime'),
      talkAgents?: long(name='TalkAgents', example='0'),
      talkingAgents?: long(name='TalkingAgents'),
      workAgents?: long(name='WorkAgents', example='0'),
      workingAgents?: long(name='WorkingAgents'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='6CCEF32F-8614-535F-A1D9-D85B8C0DC4F0'),
}

model ListCampaignTrendingReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCampaignTrendingReportResponseBody(name='body'),
}

/**
 * @summary 获取预测式外呼活动趋势报表
 *
 * @param request ListCampaignTrendingReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCampaignTrendingReportResponse
 */
async function listCampaignTrendingReportWithOptions(request: ListCampaignTrendingReportRequest, runtime: $RuntimeOptions): ListCampaignTrendingReportResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCampaignTrendingReport',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取预测式外呼活动趋势报表
 *
 * @param request ListCampaignTrendingReportRequest
 * @return ListCampaignTrendingReportResponse
 */
async function listCampaignTrendingReport(request: ListCampaignTrendingReportRequest): ListCampaignTrendingReportResponse {
  var runtime = new $RuntimeOptions{};
  return listCampaignTrendingReportWithOptions(request, runtime);
}

model ListCampaignsRequest {
  actualStartTimeFrom?: string(name='ActualStartTimeFrom', example='2021-10-14 20:59:59'),
  actualStartTimeTo?: string(name='ActualStartTimeTo', example='2021-10-14 20:59:59'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  name?: string(name='Name', example='test-campaign'),
  pageNumber?: long(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: long(name='PageSize', description='This parameter is required.', example='10'),
  planedStartTimeFrom?: string(name='PlanedStartTimeFrom', example='2021-10-14 00:00:00'),
  planedStartTimeTo?: string(name='PlanedStartTimeTo', example='2021-10-14 20:59:59'),
  queueId?: string(name='QueueId', example='skillgroup@ccc-test'),
  state?: string(name='State', example='Draft'),
}

model ListCampaignsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        actualEndTime?: long(name='ActualEndTime', example='1634008800000'),
        actualStartTime?: long(name='ActualStartTime', example='1634000460000'),
        campaignId?: string(name='CampaignId', example='6badb397-a8b5-40b6-21019d382a09'),
        casesAborted?: long(name='CasesAborted', example='0'),
        casesConnected?: long(name='CasesConnected', example='40'),
        casesUncompleted?: long(name='CasesUncompleted', example='0'),
        completionRate?: float(name='CompletionRate'),
        contactFlowId?: string(name='ContactFlowId'),
        maxAttemptCount?: long(name='MaxAttemptCount', example='1'),
        minAttemptInterval?: long(name='MinAttemptInterval', example='1'),
        name?: string(name='Name', example='test-campaign'),
        planedEndTime?: long(name='PlanedEndTime', example='1634054400000'),
        planedStartTime?: long(name='PlanedStartTime', example='1633968000000'),
        queueId?: string(name='QueueId', example='skillgroup@ccc-test'),
        queueName?: string(name='QueueName'),
        simulation?: boolean(name='Simulation', example='false'),
        state?: string(name='State', example='Completed'),
        strategyParameters?: string(name='StrategyParameters', example='{"ratio":1}'),
        strategyType?: string(name='StrategyType', example='PACING'),
        totalCases?: long(name='TotalCases', example='100'),
      }
    ](name='List'),
    pageNumber?: long(name='PageNumber', example='1'),
    pageSize?: long(name='PageSize', example='10'),
    totalCount?: long(name='TotalCount', example='1'),
  }(name='Data'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='6CCEF32F-8614-535F-A1D9-D85B8C0DC4F0'),
  success?: boolean(name='Success', example='true'),
}

model ListCampaignsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCampaignsResponseBody(name='body'),
}

/**
 * @summary 获取预测式外呼活动列表
 *
 * @param request ListCampaignsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCampaignsResponse
 */
async function listCampaignsWithOptions(request: ListCampaignsRequest, runtime: $RuntimeOptions): ListCampaignsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.actualStartTimeFrom)) {
    query['ActualStartTimeFrom'] = request.actualStartTimeFrom;
  }
  if (!$isNull(request.actualStartTimeTo)) {
    query['ActualStartTimeTo'] = request.actualStartTimeTo;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.planedStartTimeFrom)) {
    query['PlanedStartTimeFrom'] = request.planedStartTimeFrom;
  }
  if (!$isNull(request.planedStartTimeTo)) {
    query['PlanedStartTimeTo'] = request.planedStartTimeTo;
  }
  if (!$isNull(request.queueId)) {
    query['QueueId'] = request.queueId;
  }
  if (!$isNull(request.state)) {
    query['State'] = request.state;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCampaigns',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取预测式外呼活动列表
 *
 * @param request ListCampaignsRequest
 * @return ListCampaignsResponse
 */
async function listCampaigns(request: ListCampaignsRequest): ListCampaignsResponse {
  var runtime = new $RuntimeOptions{};
  return listCampaignsWithOptions(request, runtime);
}

model ListCasesRequest {
  campaignId?: string(name='CampaignId', description='This parameter is required.', example='6badb397-a8b5-40b6-21019d382a09'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: long(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: long(name='PageSize', description='This parameter is required.', example='100'),
  phoneNumber?: string(name='PhoneNumber'),
  state?: string(name='State'),
}

model ListCasesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        abandonPhase?: string(name='AbandonPhase'),
        abandonType?: string(name='AbandonType', example='NA'),
        attemptCount?: long(name='AttemptCount', example='1'),
        caseId?: string(name='CaseId', example='60ecb1a2-4480-4d01-bede-c5b7655bfadf'),
        customVariables?: string(name='CustomVariables'),
        failureReason?: string(name='FailureReason'),
        phoneNumber?: string(name='PhoneNumber', example='1888888****'),
        state?: string(name='State', example='Connected'),
      }
    ](name='List'),
    pageNumber?: long(name='PageNumber', example='1'),
    pageSize?: long(name='PageSize', example='100'),
    totalCount?: long(name='TotalCount', example='1'),
  }(name='Data'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='7CC6523B-0E51-1B62-8DA5-6A9831CAE316'),
}

model ListCasesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCasesResponseBody(name='body'),
}

/**
 * @summary 获取预测式外呼活动的联系人呼叫详情
 *
 * @param request ListCasesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCasesResponse
 */
async function listCasesWithOptions(request: ListCasesRequest, runtime: $RuntimeOptions): ListCasesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.campaignId)) {
    query['CampaignId'] = request.campaignId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.phoneNumber)) {
    query['PhoneNumber'] = request.phoneNumber;
  }
  if (!$isNull(request.state)) {
    query['State'] = request.state;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCases',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取预测式外呼活动的联系人呼叫详情
 *
 * @param request ListCasesRequest
 * @return ListCasesResponse
 */
async function listCases(request: ListCasesRequest): ListCasesResponse {
  var runtime = new $RuntimeOptions{};
  return listCasesWithOptions(request, runtime);
}

model ListCategoriesRequest {
  categoryId?: string(name='CategoryId', example='43c2671b-***-***-86d0-6bd187905cc8'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  type?: string(name='Type', example='Ticket'),
}

model ListCategoriesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='DE803553-8AA9-4B9D-9E4E-A82BC69EDCEE'),
}

model ListCategoriesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCategoriesResponseBody(name='body'),
}

/**
 * @param request ListCategoriesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCategoriesResponse
 */
async function listCategoriesWithOptions(request: ListCategoriesRequest, runtime: $RuntimeOptions): ListCategoriesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.categoryId)) {
    query['CategoryId'] = request.categoryId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCategories',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListCategoriesRequest
 * @return ListCategoriesResponse
 */
async function listCategories(request: ListCategoriesRequest): ListCategoriesResponse {
  var runtime = new $RuntimeOptions{};
  return listCategoriesWithOptions(request, runtime);
}

model ListCommonTicketFieldsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model ListCommonTicketFieldsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    createdTime?: string(name='CreatedTime', example='1703517780627'),
    id?: string(name='Id', description='Schema ID。', example='ticketing'),
    instanceId?: string(name='InstanceId', example='ccc-test'),
    properties?: map[string]DataPropertiesValue(name='Properties'),
    updatedTime?: string(name='UpdatedTime', example='1716211430928'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='30C7D235-DDCF-4C7F-A462-5E2598252C2B'),
}

model ListCommonTicketFieldsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCommonTicketFieldsResponseBody(name='body'),
}

/**
 * @param request ListCommonTicketFieldsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCommonTicketFieldsResponse
 */
async function listCommonTicketFieldsWithOptions(request: ListCommonTicketFieldsRequest, runtime: $RuntimeOptions): ListCommonTicketFieldsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCommonTicketFields',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListCommonTicketFieldsRequest
 * @return ListCommonTicketFieldsResponse
 */
async function listCommonTicketFields(request: ListCommonTicketFieldsRequest): ListCommonTicketFieldsResponse {
  var runtime = new $RuntimeOptions{};
  return listCommonTicketFieldsWithOptions(request, runtime);
}

model ListConfigItemsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  objectId?: string(name='ObjectId', description='This parameter is required.', example='ccc-test'),
  objectType?: string(name='ObjectType', description='This parameter is required.', example='INSTANCE'),
}

model ListConfigItemsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      instanceId?: string(name='InstanceId', example='ccc-test'),
      name?: string(name='Name', example='config-item'),
      objectId?: string(name='ObjectId', example='ccc-test'),
      objectType?: string(name='ObjectType', example='INSTANCE'),
      value?: string(name='Value', example='100'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ListConfigItemsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListConfigItemsResponseBody(name='body'),
}

/**
 * @param request ListConfigItemsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListConfigItemsResponse
 */
async function listConfigItemsWithOptions(request: ListConfigItemsRequest, runtime: $RuntimeOptions): ListConfigItemsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.objectId)) {
    query['ObjectId'] = request.objectId;
  }
  if (!$isNull(request.objectType)) {
    query['ObjectType'] = request.objectType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListConfigItems',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListConfigItemsRequest
 * @return ListConfigItemsResponse
 */
async function listConfigItems(request: ListConfigItemsRequest): ListConfigItemsResponse {
  var runtime = new $RuntimeOptions{};
  return listConfigItemsWithOptions(request, runtime);
}

model ListContactFlowsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  orderByField?: string(name='OrderByField'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  sortOrder?: string(name='SortOrder'),
  type?: string(name='Type', example='MAIN_FLOW'),
}

model ListContactFlowsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        contactFlowId?: string(name='ContactFlowId', example='78128960-bb00-4ddc-8e82-923a8c5bd22d'),
        createdTime?: string(name='CreatedTime', example='2021-03-05 17:35:45.0'),
        definition?: string(name='Definition'),
        description?: string(name='Description', example='1.0'),
        draftId?: string(name='DraftId', example='db07c0bb-6b1f-47d2-b37e-2451c617562d'),
        editor?: string(name='Editor', example='ccc-test'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        name?: string(name='Name'),
        numberList?: [ string ](name='NumberList'),
        published?: boolean(name='Published', example='true'),
        type?: string(name='Type', example='MAIN_FLOW'),
        updatedTime?: string(name='UpdatedTime', example='2021-03-08 15:34:49.0'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ListContactFlowsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListContactFlowsResponseBody(name='body'),
}

/**
 * @param request ListContactFlowsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListContactFlowsResponse
 */
async function listContactFlowsWithOptions(request: ListContactFlowsRequest, runtime: $RuntimeOptions): ListContactFlowsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.orderByField)) {
    query['OrderByField'] = request.orderByField;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListContactFlows',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListContactFlowsRequest
 * @return ListContactFlowsResponse
 */
async function listContactFlows(request: ListContactFlowsRequest): ListContactFlowsResponse {
  var runtime = new $RuntimeOptions{};
  return listContactFlowsWithOptions(request, runtime);
}

model ListCustomCallTaggingRequest {
  callTagNameList?: string(name='CallTagNameList', example='["TagA"]'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  searchPattern?: string(name='SearchPattern', example='1312121****'),
}

model ListCustomCallTaggingResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        callTagList?: [ 
          {
            instanceId?: string(name='InstanceId', example='ccc-test'),
            tagName?: string(name='TagName', example='TagA'),
          }
        ](name='CallTagList'),
        creator?: string(name='Creator', example='agent'),
        description?: string(name='Description'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        number?: string(name='Number', example='1312121****'),
        updateTime?: string(name='UpdateTime', example='2020-07-05 00:00:00.0'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='10'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model ListCustomCallTaggingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCustomCallTaggingResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI ListCustomCallTagging is deprecated, please use CCC::2020-07-01::ListCustomCallTaggings instead.
 *
 * @summary 列出呼入控制号码
 *
 * @param request ListCustomCallTaggingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCustomCallTaggingResponse
 */
// Deprecated
async function listCustomCallTaggingWithOptions(request: ListCustomCallTaggingRequest, runtime: $RuntimeOptions): ListCustomCallTaggingResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.callTagNameList)) {
    query['CallTagNameList'] = request.callTagNameList;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.searchPattern)) {
    query['SearchPattern'] = request.searchPattern;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCustomCallTagging',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @deprecated OpenAPI ListCustomCallTagging is deprecated, please use CCC::2020-07-01::ListCustomCallTaggings instead.
 *
 * @summary 列出呼入控制号码
 *
 * @param request ListCustomCallTaggingRequest
 * @return ListCustomCallTaggingResponse
 */
// Deprecated
async function listCustomCallTagging(request: ListCustomCallTaggingRequest): ListCustomCallTaggingResponse {
  var runtime = new $RuntimeOptions{};
  return listCustomCallTaggingWithOptions(request, runtime);
}

model ListDevicesRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model ListDevicesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      callId?: string(name='CallId', example='d7b818c3-8d3a-732f-bc9e-1782wa16****'),
      contact?: string(name='Contact', example='sip:8032****@33.89.XX.XX:64189;transport=tcp;registering_acc=18_134_23_4'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      deviceType?: string(name='DeviceType'),
      expires?: long(name='Expires', example='1609118499750'),
      extension?: string(name='Extension', example='8032****'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      userId?: string(name='UserId', example='agent@ccc-test'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ListDevicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDevicesResponseBody(name='body'),
}

/**
 * @param request ListDevicesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDevicesResponse
 */
async function listDevicesWithOptions(request: ListDevicesRequest, runtime: $RuntimeOptions): ListDevicesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListDevices',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListDevicesRequest
 * @return ListDevicesResponse
 */
async function listDevices(request: ListDevicesRequest): ListDevicesResponse {
  var runtime = new $RuntimeOptions{};
  return listDevicesWithOptions(request, runtime);
}

model ListDoNotCallNumbersRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  scope?: string(name='Scope', example='INSTANCE'),
  searchPattern?: string(name='SearchPattern', example='RemarkA'),
}

model ListDoNotCallNumbersResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        createTime?: long(name='CreateTime', example='1626962425000'),
        createdTime?: long(name='CreatedTime'),
        creator?: string(name='Creator', example='agent'),
        number?: string(name='Number', example='1900000****'),
        remark?: string(name='Remark'),
        scope?: string(name='Scope', example='INSTANCE'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model ListDoNotCallNumbersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDoNotCallNumbersResponseBody(name='body'),
}

/**
 * @summary 查询黑名单号码
 *
 * @param request ListDoNotCallNumbersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDoNotCallNumbersResponse
 */
async function listDoNotCallNumbersWithOptions(request: ListDoNotCallNumbersRequest, runtime: $RuntimeOptions): ListDoNotCallNumbersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.scope)) {
    query['Scope'] = request.scope;
  }
  if (!$isNull(request.searchPattern)) {
    query['SearchPattern'] = request.searchPattern;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListDoNotCallNumbers',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询黑名单号码
 *
 * @param request ListDoNotCallNumbersRequest
 * @return ListDoNotCallNumbersResponse
 */
async function listDoNotCallNumbers(request: ListDoNotCallNumbersRequest): ListDoNotCallNumbersResponse {
  var runtime = new $RuntimeOptions{};
  return listDoNotCallNumbersWithOptions(request, runtime);
}

model ListDocumentsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='d278629c-c687-4aa3-b044-4fe9b012e7ef'),
  nextPageToken?: string(name='NextPageToken', example='eyJ0YWJsZUlkIjoiY2Y2MTQxYjA5NDY0NDUxMzk5YjFjMTA5YTMxZWNkMzEiLCJ0b2tlbiI6IjAwMDAwMDAwMDAwNzAzNzcifQ=='),
  pageSize?: int32(name='PageSize', example='2'),
  requestId?: string(name='RequestId', example='EAF3C248-E123-441B-A545-B6CD02E98EED'),
  schemaId?: string(name='SchemaId', description='schema id

This parameter is required.', example='profile'),
  searchPattern?: string(name='SearchPattern'),
  sorts?: [ 
    {
      order?: string(name='Order', example='desc'),
      propertyName?: string(name='PropertyName', example='name'),
    }
  ](name='Sorts'),
}

model ListDocumentsShrinkRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='d278629c-c687-4aa3-b044-4fe9b012e7ef'),
  nextPageToken?: string(name='NextPageToken', example='eyJ0YWJsZUlkIjoiY2Y2MTQxYjA5NDY0NDUxMzk5YjFjMTA5YTMxZWNkMzEiLCJ0b2tlbiI6IjAwMDAwMDAwMDAwNzAzNzcifQ=='),
  pageSize?: int32(name='PageSize', example='2'),
  requestId?: string(name='RequestId', example='EAF3C248-E123-441B-A545-B6CD02E98EED'),
  schemaId?: string(name='SchemaId', description='schema id

This parameter is required.', example='profile'),
  searchPattern?: string(name='SearchPattern'),
  sortsShrink?: string(name='Sorts'),
}

model ListDocumentsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    documents?: [  map[string]any ](name='Documents'),
    nextPageToken?: string(name='NextPageToken', example='54d1a616d95a4a01ba58967a9115b649'),
    schema?: {
      createdTime?: string(name='CreatedTime', example='2020-10-14T09:53:53Z'),
      deleted?: boolean(name='Deleted', example='false'),
      description?: string(name='Description', example='-'),
      id?: string(name='Id', description='schame id', example='profile'),
      instanceId?: string(name='InstanceId', example='87b12784-8ce2-40b6-b21f-c49cb3b5501e'),
      properties?: map[string]DataSchemaPropertiesValue(name='Properties'),
      updatedTime?: string(name='UpdatedTime', example='2020-10-14T09:53:53Z'),
    }(name='Schema', description='scheme'),
    totalCount?: long(name='TotalCount', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='7BEEA660-A45A-45E3-98CC-AFC65E715C23'),
}

model ListDocumentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDocumentsResponseBody(name='body'),
}

/**
 * @param tmpReq ListDocumentsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDocumentsResponse
 */
async function listDocumentsWithOptions(tmpReq: ListDocumentsRequest, runtime: $RuntimeOptions): ListDocumentsResponse {
  tmpReq.validate();
  var request = new ListDocumentsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.sorts)) {
    request.sortsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sorts, 'Sorts', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.nextPageToken)) {
    body['NextPageToken'] = request.nextPageToken;
  }
  if (!$isNull(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  if (!$isNull(request.schemaId)) {
    body['SchemaId'] = request.schemaId;
  }
  if (!$isNull(request.searchPattern)) {
    body['SearchPattern'] = request.searchPattern;
  }
  if (!$isNull(request.sortsShrink)) {
    body['Sorts'] = request.sortsShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListDocuments',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListDocumentsRequest
 * @return ListDocumentsResponse
 */
async function listDocuments(request: ListDocumentsRequest): ListDocumentsResponse {
  var runtime = new $RuntimeOptions{};
  return listDocumentsWithOptions(request, runtime);
}

model ListFlashSmsApplicationsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  name?: string(name='Name'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='100'),
  providerId?: string(name='ProviderId', example='Uincall'),
}

model ListFlashSmsApplicationsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        applicationId?: string(name='ApplicationId', example='71b396fa-***********-bd80e070b7c0'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        name?: string(name='Name'),
        providerId?: string(name='ProviderId', example='Uincall'),
        value?: string(name='Value', example='{"user":"600******_dev","pwd":"85abf3**********f494e","account":"6004******"}'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='100'),
    totalCount?: int32(name='TotalCount', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='7BEEA660-A45A-45E3-98CC-AFC65E715C23'),
}

model ListFlashSmsApplicationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFlashSmsApplicationsResponseBody(name='body'),
}

/**
 * @param request ListFlashSmsApplicationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListFlashSmsApplicationsResponse
 */
async function listFlashSmsApplicationsWithOptions(request: ListFlashSmsApplicationsRequest, runtime: $RuntimeOptions): ListFlashSmsApplicationsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.providerId)) {
    query['ProviderId'] = request.providerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListFlashSmsApplications',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListFlashSmsApplicationsRequest
 * @return ListFlashSmsApplicationsResponse
 */
async function listFlashSmsApplications(request: ListFlashSmsApplicationsRequest): ListFlashSmsApplicationsResponse {
  var runtime = new $RuntimeOptions{};
  return listFlashSmsApplicationsWithOptions(request, runtime);
}

model ListFlashSmsTemplatesRequest {
  applicationId?: string(name='ApplicationId', example='71b396fa-1*********-70b7c0'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  providerId?: string(name='ProviderId', example='Uincall'),
}

model ListFlashSmsTemplatesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      templateId?: string(name='TemplateId', example='1715*****38'),
      templateName?: string(name='TemplateName'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='7BEEA660-A45A-45E3-98CC-AFC65E715C23'),
}

model ListFlashSmsTemplatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFlashSmsTemplatesResponseBody(name='body'),
}

/**
 * @param request ListFlashSmsTemplatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListFlashSmsTemplatesResponse
 */
async function listFlashSmsTemplatesWithOptions(request: ListFlashSmsTemplatesRequest, runtime: $RuntimeOptions): ListFlashSmsTemplatesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.applicationId)) {
    query['ApplicationId'] = request.applicationId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.providerId)) {
    query['ProviderId'] = request.providerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListFlashSmsTemplates',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListFlashSmsTemplatesRequest
 * @return ListFlashSmsTemplatesResponse
 */
async function listFlashSmsTemplates(request: ListFlashSmsTemplatesRequest): ListFlashSmsTemplatesResponse {
  var runtime = new $RuntimeOptions{};
  return listFlashSmsTemplatesWithOptions(request, runtime);
}

model ListGroupChatMessagesRequest {
  instanceId?: string(name='InstanceId', example='ccc-test'),
  jobId?: string(name='JobId', example='chat-65382141036853491'),
  nextPageToken?: string(name='NextPageToken', example='b2ad450b116e4f8396e58108acf5c020'),
  pageSize?: int32(name='PageSize', example='10'),
  sortOrder?: string(name='SortOrder', example='DESC'),
}

model ListGroupChatMessagesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    messages?: [ 
      {
        content?: string(name='Content'),
        jobId?: string(name='JobId', example='chat-65382141036853491'),
        recalled?: boolean(name='Recalled', example='false'),
        senderAvatarUrl?: string(name='SenderAvatarUrl', example='http://xxxxx.com'),
        senderId?: string(name='SenderId', example='64bb4ececc34fc5ec1ca1153'),
        senderName?: string(name='SenderName', example='test-agent@test-instanceId'),
        senderType?: string(name='SenderType', example='CUSTOMER'),
        timestamp?: long(name='Timestamp', example='1696126980371'),
      }
    ](name='Messages'),
    nextPageToken?: string(name='NextPageToken', example='54d1a616d95a4a01ba58967a9115b649'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='2263B273-AC1B-44EB-BA98-87F2322C6780'),
}

model ListGroupChatMessagesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListGroupChatMessagesResponseBody(name='body'),
}

/**
 * @summary ListGroupChatMessages
 *
 * @param request ListGroupChatMessagesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListGroupChatMessagesResponse
 */
async function listGroupChatMessagesWithOptions(request: ListGroupChatMessagesRequest, runtime: $RuntimeOptions): ListGroupChatMessagesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.nextPageToken)) {
    query['NextPageToken'] = request.nextPageToken;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListGroupChatMessages',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary ListGroupChatMessages
 *
 * @param request ListGroupChatMessagesRequest
 * @return ListGroupChatMessagesResponse
 */
async function listGroupChatMessages(request: ListGroupChatMessagesRequest): ListGroupChatMessagesResponse {
  var runtime = new $RuntimeOptions{};
  return listGroupChatMessagesWithOptions(request, runtime);
}

model ListHistoricalAgentReportRequest {
  agentIdList?: string(name='AgentIdList', example='["agent1@ccc-test", "agent2@ccc-test"]'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  mediaType?: string(name='MediaType'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='100'),
  skillGroupId?: string(name='SkillGroupId'),
  startTime?: long(name='StartTime', example='1532448000000'),
  stopTime?: long(name='StopTime', example='1532707199000'),
}

model ListHistoricalAgentReportResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        agentId?: string(name='AgentId', example='agent1@ccc-test'),
        agentName?: string(name='AgentName'),
        back2Back?: {
          agentHandleRate?: string(name='AgentHandleRate'),
          answerRate?: string(name='AnswerRate'),
          averageCustomerRingTime?: string(name='AverageCustomerRingTime'),
          averageRingTime?: string(name='AverageRingTime'),
          averageTalkTime?: string(name='AverageTalkTime'),
          callsAgentHandled?: string(name='CallsAgentHandled'),
          callsAnswered?: string(name='CallsAnswered'),
          callsCustomerAnswered?: string(name='CallsCustomerAnswered'),
          callsDialed?: string(name='CallsDialed'),
          customerAnswerRate?: string(name='CustomerAnswerRate'),
          maxCustomerRingTime?: string(name='MaxCustomerRingTime'),
          maxRingTime?: string(name='MaxRingTime'),
          maxTalkTime?: string(name='MaxTalkTime'),
          totalCustomerRingTime?: string(name='TotalCustomerRingTime'),
          totalRingTime?: string(name='TotalRingTime'),
          totalTalkTime?: string(name='TotalTalkTime'),
        }(name='Back2Back'),
        displayId?: string(name='DisplayId', example='001'),
        inbound?: {
          accessChannelTypeDetails?: [ 
            {
              accessChannelType?: string(name='AccessChannelType'),
              callsOffered?: long(name='CallsOffered'),
            }
          ](name='AccessChannelTypeDetails'),
          averageFirstResponseTime?: float(name='AverageFirstResponseTime'),
          averageHoldTime?: float(name='AverageHoldTime', example='0'),
          averageResponseTime?: float(name='AverageResponseTime'),
          averageRingTime?: float(name='AverageRingTime', example='0'),
          averageTalkTime?: float(name='AverageTalkTime', example='0'),
          averageWorkTime?: float(name='AverageWorkTime', example='0'),
          callsAttendedTransferIn?: long(name='CallsAttendedTransferIn', example='0'),
          callsAttendedTransferOut?: long(name='CallsAttendedTransferOut', example='0'),
          callsBlindTransferIn?: long(name='CallsBlindTransferIn', example='0'),
          callsBlindTransferOut?: long(name='CallsBlindTransferOut', example='0'),
          callsHandled?: long(name='CallsHandled', example='0'),
          callsHold?: long(name='CallsHold', example='0'),
          callsOffered?: long(name='CallsOffered', example='0'),
          callsRinged?: long(name='CallsRinged', example='0'),
          handleRate?: float(name='HandleRate', example='0'),
          maxHoldTime?: long(name='MaxHoldTime', example='0'),
          maxRingTime?: long(name='MaxRingTime', example='0'),
          maxTalkTime?: long(name='MaxTalkTime', example='0'),
          maxWorkTime?: long(name='MaxWorkTime', example='0'),
          satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
          satisfactionRate?: float(name='SatisfactionRate', example='0'),
          satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
          satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
          serviceLevel15?: float(name='ServiceLevel15'),
          totalHoldTime?: long(name='TotalHoldTime', example='0'),
          totalMessagesSent?: long(name='TotalMessagesSent'),
          totalMessagesSentByAgent?: long(name='TotalMessagesSentByAgent'),
          totalMessagesSentByCustomer?: string(name='TotalMessagesSentByCustomer'),
          totalRingTime?: long(name='TotalRingTime', example='0'),
          totalTalkTime?: long(name='TotalTalkTime', example='0'),
          totalWorkTime?: long(name='TotalWorkTime', example='0'),
        }(name='Inbound'),
        internal?: {
          averageTalkTime?: float(name='AverageTalkTime'),
          callsAnswered?: long(name='CallsAnswered'),
          callsDialed?: long(name='CallsDialed'),
          callsHandled?: long(name='CallsHandled'),
          callsOffered?: long(name='CallsOffered'),
          callsTalked?: long(name='CallsTalked'),
          maxTalkTime?: long(name='MaxTalkTime'),
          totalTalkTime?: long(name='TotalTalkTime'),
        }(name='Internal'),
        outbound?: {
          answerRate?: float(name='AnswerRate', example='0'),
          averageDialingTime?: float(name='AverageDialingTime', example='0'),
          averageHoldTime?: float(name='AverageHoldTime', example='0'),
          averageRingTime?: float(name='AverageRingTime', example='0'),
          averageTalkTime?: float(name='AverageTalkTime', example='0'),
          averageWorkTime?: float(name='AverageWorkTime', example='0'),
          callsAnswered?: long(name='CallsAnswered', example='0'),
          callsAttendedTransferIn?: long(name='CallsAttendedTransferIn', example='0'),
          callsAttendedTransferOut?: long(name='CallsAttendedTransferOut', example='0'),
          callsBlindTransferIn?: long(name='CallsBlindTransferIn', example='0'),
          callsBlindTransferOut?: long(name='CallsBlindTransferOut', example='0'),
          callsDialed?: long(name='CallsDialed', example='0'),
          callsHold?: long(name='CallsHold', example='0'),
          callsRinged?: long(name='CallsRinged', example='0'),
          maxDialingTime?: long(name='MaxDialingTime', example='0'),
          maxHoldTime?: long(name='MaxHoldTime', example='0'),
          maxRingTime?: long(name='MaxRingTime', example='0'),
          maxTalkTime?: long(name='MaxTalkTime', example='0'),
          maxWorkTime?: long(name='MaxWorkTime', example='0'),
          satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
          satisfactionRate?: float(name='SatisfactionRate', example='0'),
          satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
          satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
          totalDialingTime?: long(name='TotalDialingTime', example='0'),
          totalHoldTime?: long(name='TotalHoldTime', example='0'),
          totalRingTime?: long(name='TotalRingTime', example='0'),
          totalTalkTime?: long(name='TotalTalkTime', example='0'),
          totalWorkTime?: long(name='TotalWorkTime', example='0'),
        }(name='Outbound'),
        overall?: {
          averageBreakTime?: float(name='AverageBreakTime', example='0'),
          averageHoldTime?: float(name='AverageHoldTime', example='0'),
          averageReadyTime?: float(name='AverageReadyTime', example='0'),
          averageTalkTime?: float(name='AverageTalkTime', example='0'),
          averageWorkTime?: float(name='AverageWorkTime', example='0'),
          breakCodeDetailList?: [ 
            {
              breakCode?: string(name='BreakCode'),
              count?: long(name='Count'),
              duration?: long(name='Duration'),
            }
          ](name='BreakCodeDetailList'),
          firstCheckInTime?: long(name='FirstCheckInTime'),
          lastCheckOutTime?: long(name='LastCheckOutTime'),
          maxBreakTime?: long(name='MaxBreakTime', example='0'),
          maxHoldTime?: long(name='MaxHoldTime', example='0'),
          maxReadyTime?: long(name='MaxReadyTime', example='0'),
          maxTalkTime?: long(name='MaxTalkTime', example='0'),
          maxWorkTime?: long(name='MaxWorkTime', example='0'),
          occupancyRate?: float(name='OccupancyRate', example='0'),
          satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
          satisfactionRate?: float(name='SatisfactionRate', example='0'),
          satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
          satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
          totalBreakTime?: long(name='TotalBreakTime', example='0'),
          totalCalls?: long(name='TotalCalls', example='0'),
          totalHoldTime?: long(name='TotalHoldTime', example='0'),
          totalLoggedInTime?: long(name='TotalLoggedInTime', example='0'),
          totalOffSiteLoggedInTime?: long(name='TotalOffSiteLoggedInTime'),
          totalOffSiteOnlineTime?: long(name='TotalOffSiteOnlineTime', example='已弃用，请使用TotalOffSiteLoggedInTime代替此参数'),
          totalOfficePhoneLoggedInTime?: long(name='TotalOfficePhoneLoggedInTime'),
          totalOfficePhoneOnlineTime?: long(name='TotalOfficePhoneOnlineTime', example='已弃用，请使用TotalOfficePhoneLoggedInTime代替此参数'),
          totalOnSiteLoggedInTime?: long(name='TotalOnSiteLoggedInTime'),
          totalOnSiteOnlineTime?: long(name='TotalOnSiteOnlineTime', example='已弃用，请使用TotalOnSiteLoggedInTime代替此参数'),
          totalOutboundScenarioLoggedInTime?: long(name='TotalOutboundScenarioLoggedInTime'),
          totalOutboundScenarioReadyTime?: long(name='TotalOutboundScenarioReadyTime'),
          totalOutboundScenarioTime?: long(name='TotalOutboundScenarioTime', example='已弃用，请使用TotalOutboundScenarioLoggedInTime代替此参数'),
          totalReadyTime?: long(name='TotalReadyTime', example='0'),
          totalTalkTime?: long(name='TotalTalkTime', example='0'),
          totalWorkTime?: long(name='TotalWorkTime', example='0'),
        }(name='Overall'),
        skillGroupIds?: string(name='SkillGroupIds', example='["skillgroup1@ccc-test","skillgroup2@ccc-test"]'),
        skillGroupNames?: string(name='SkillGroupNames'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='100'),
    totalCount?: int32(name='TotalCount', example='10'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ListHistoricalAgentReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListHistoricalAgentReportResponseBody(name='body'),
}

/**
 * @param request ListHistoricalAgentReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListHistoricalAgentReportResponse
 */
async function listHistoricalAgentReportWithOptions(request: ListHistoricalAgentReportRequest, runtime: $RuntimeOptions): ListHistoricalAgentReportResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.stopTime)) {
    query['StopTime'] = request.stopTime;
  }
  var body : map[string]any = {};
  if (!$isNull(request.agentIdList)) {
    body['AgentIdList'] = request.agentIdList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListHistoricalAgentReport',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListHistoricalAgentReportRequest
 * @return ListHistoricalAgentReportResponse
 */
async function listHistoricalAgentReport(request: ListHistoricalAgentReportRequest): ListHistoricalAgentReportResponse {
  var runtime = new $RuntimeOptions{};
  return listHistoricalAgentReportWithOptions(request, runtime);
}

model ListHistoricalAgentSkillGroupReportRequest {
  agentIdList?: string(name='AgentIdList', example='["agent1@ccc-test", "agent2@ccc-test"]'),
  endTime?: long(name='EndTime', example='1620273600000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  mediaType?: string(name='MediaType'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  skillGroupIdList?: string(name='SkillGroupIdList', example='[
      "skg1@ccc-test",
      "skg2@ccc-test"
]'),
  startTime?: long(name='StartTime', example='1634140800000'),
}

model ListHistoricalAgentSkillGroupReportResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        agentId?: string(name='AgentId', example='agent1@ccc-test'),
        agentName?: string(name='AgentName'),
        back2Back?: {
          agentAnswerRate?: float(name='AgentAnswerRate', example='0.5'),
          agentHandleRate?: float(name='AgentHandleRate'),
          answerRate?: float(name='AnswerRate', example='0.6'),
          averageCustomerRingTime?: float(name='AverageCustomerRingTime', example='100'),
          averageRingTime?: float(name='AverageRingTime', example='100'),
          averageTalkTime?: long(name='AverageTalkTime', example='100'),
          callsAgentHandled?: long(name='CallsAgentHandled'),
          callsAnswered?: long(name='CallsAnswered', example='100'),
          callsCustomerAnswered?: long(name='CallsCustomerAnswered'),
          callsCustomerHandled?: long(name='CallsCustomerHandled', example='100'),
          callsDialed?: long(name='CallsDialed', example='100'),
          customerAnswerRate?: float(name='CustomerAnswerRate'),
          customerHandleRate?: float(name='CustomerHandleRate', example='0.5'),
          maxCustomerRingTime?: long(name='MaxCustomerRingTime', example='100'),
          maxRingTime?: long(name='MaxRingTime', example='100'),
          maxTalkTime?: long(name='MaxTalkTime', example='100'),
          totalCustomerRingTime?: long(name='TotalCustomerRingTime', example='100'),
          totalRingTime?: long(name='TotalRingTime', example='100'),
          totalTalkTime?: long(name='TotalTalkTime', example='100'),
        }(name='Back2Back'),
        displayId?: string(name='DisplayId', example='1001'),
        inbound?: {
          averageFirstResponseTime?: float(name='AverageFirstResponseTime'),
          averageHoldTime?: float(name='AverageHoldTime', example='100'),
          averageResponseTime?: float(name='AverageResponseTime'),
          averageRingTime?: float(name='AverageRingTime', example='100'),
          averageTalkTime?: float(name='AverageTalkTime', example='100'),
          averageWorkTime?: float(name='AverageWorkTime', example='100'),
          callsAttendedTransferIn?: long(name='CallsAttendedTransferIn', example='100'),
          callsAttendedTransferOut?: long(name='CallsAttendedTransferOut', example='100'),
          callsBlindTransferIn?: long(name='CallsBlindTransferIn', example='100'),
          callsBlindTransferOut?: long(name='CallsBlindTransferOut', example='100'),
          callsHandled?: long(name='CallsHandled', example='100'),
          callsHold?: long(name='CallsHold', example='100'),
          callsOffered?: long(name='CallsOffered', example='100'),
          callsRinged?: long(name='CallsRinged', example='100'),
          handleRate?: float(name='HandleRate', example='100'),
          maxHoldTime?: long(name='MaxHoldTime', example='100'),
          maxRingTime?: long(name='MaxRingTime', example='100'),
          maxTalkTime?: long(name='MaxTalkTime', example='100'),
          maxWorkTime?: long(name='MaxWorkTime', example='100'),
          satisfactionIndex?: float(name='SatisfactionIndex', example='100'),
          satisfactionRate?: float(name='SatisfactionRate', example='0.5'),
          satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='100'),
          satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='100'),
          totalHoldTime?: long(name='TotalHoldTime', example='100'),
          totalMessagesSent?: long(name='TotalMessagesSent'),
          totalMessagesSentByAgent?: long(name='TotalMessagesSentByAgent'),
          totalMessagesSentByCustomer?: long(name='TotalMessagesSentByCustomer'),
          totalRingTime?: long(name='TotalRingTime', example='100'),
          totalTalkTime?: long(name='TotalTalkTime', example='100'),
          totalWorkTime?: long(name='TotalWorkTime', example='100'),
        }(name='Inbound'),
        internal?: {
          averageTalkTime?: long(name='AverageTalkTime', example='100'),
          callsAnswered?: long(name='CallsAnswered', example='100'),
          callsDialed?: long(name='CallsDialed', example='100'),
          callsHandled?: long(name='CallsHandled', example='100'),
          callsOffered?: long(name='CallsOffered', example='100'),
          callsTalk?: long(name='CallsTalk', example='100'),
          callsTalked?: long(name='CallsTalked'),
          maxTalkTime?: long(name='MaxTalkTime', example='100'),
          totalTalkTime?: long(name='TotalTalkTime', example='100'),
        }(name='Internal'),
        outbound?: {
          answerRate?: float(name='AnswerRate', example='0.5'),
          averageDialingTime?: float(name='AverageDialingTime', example='100'),
          averageHoldTime?: float(name='AverageHoldTime', example='100'),
          averageRingTime?: float(name='AverageRingTime', example='100'),
          averageTalkTime?: float(name='AverageTalkTime', example='100'),
          averageWorkTime?: float(name='AverageWorkTime', example='100'),
          callsAnswered?: long(name='CallsAnswered', example='100'),
          callsAttendedTransferIn?: long(name='CallsAttendedTransferIn', example='100'),
          callsAttendedTransferOut?: long(name='CallsAttendedTransferOut', example='100'),
          callsBlindTransferIn?: long(name='CallsBlindTransferIn', example='100'),
          callsBlindTransferOut?: long(name='CallsBlindTransferOut', example='100'),
          callsDialed?: long(name='CallsDialed', example='100'),
          callsHold?: long(name='CallsHold', example='100'),
          callsRinged?: long(name='CallsRinged', example='100'),
          maxDialingTime?: long(name='MaxDialingTime', example='100'),
          maxHoldTime?: long(name='MaxHoldTime', example='100'),
          maxRingTime?: long(name='MaxRingTime', example='100'),
          maxTalkTime?: long(name='MaxTalkTime', example='100'),
          maxWorkTime?: long(name='MaxWorkTime', example='100'),
          satisfactionIndex?: float(name='SatisfactionIndex', example='1.4'),
          satisfactionRate?: float(name='SatisfactionRate', example='0.5'),
          satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='100'),
          satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='100'),
          totalDialingTime?: long(name='TotalDialingTime', example='100'),
          totalHoldTime?: long(name='TotalHoldTime', example='100'),
          totalRingTime?: long(name='TotalRingTime', example='100'),
          totalTalkTime?: long(name='TotalTalkTime', example='100'),
          totalWorkTime?: long(name='TotalWorkTime', example='100'),
        }(name='Outbound'),
        overall?: {
          averageBreakTime?: float(name='AverageBreakTime', example='100'),
          averageHoldTime?: float(name='AverageHoldTime', example='100'),
          averageReadyTime?: float(name='AverageReadyTime', example='100'),
          averageTalkTime?: float(name='AverageTalkTime', example='100'),
          averageWorkTime?: float(name='AverageWorkTime', example='100'),
          breakCodeDetailList?: [ 
            {
              breakCode?: string(name='BreakCode'),
              count?: long(name='Count', example='1'),
              duration?: long(name='Duration', example='100'),
            }
          ](name='BreakCodeDetailList'),
          firstCheckInTime?: long(name='FirstCheckInTime', example='1686030515000'),
          lastCheckOutTime?: long(name='LastCheckOutTime', example='1686030515000'),
          maxBreakTime?: long(name='MaxBreakTime', example='100'),
          maxHoldTime?: long(name='MaxHoldTime', example='100'),
          maxReadyTime?: long(name='MaxReadyTime', example='100'),
          maxTalkTime?: long(name='MaxTalkTime', example='100'),
          maxWorkTime?: long(name='MaxWorkTime', example='100'),
          occupancyRate?: float(name='OccupancyRate', example='0.5'),
          satisfactionIndex?: float(name='SatisfactionIndex', example='1.4'),
          satisfactionRate?: float(name='SatisfactionRate', example='0.5'),
          satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='100'),
          satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='100'),
          totalBreakTime?: long(name='TotalBreakTime', example='100'),
          totalCalls?: long(name='TotalCalls', example='100'),
          totalHoldTime?: long(name='TotalHoldTime', example='100'),
          totalLoggedInTime?: long(name='TotalLoggedInTime', example='100'),
          totalOffSiteLggedInTime?: long(name='TotalOffSiteLggedInTime'),
          totalOfficePhoneLoggedInTime?: long(name='TotalOfficePhoneLoggedInTime'),
          totalOnSiteLoggedInTime?: string(name='TotalOnSiteLoggedInTime'),
          totalOutboundScenarioLoggedInTime?: long(name='TotalOutboundScenarioLoggedInTime'),
          totalOutboundScenarioReadyTime?: long(name='TotalOutboundScenarioReadyTime', example='100'),
          totalOutboundScenarioTime?: long(name='TotalOutboundScenarioTime', example='100'),
          totalReadyTime?: long(name='TotalReadyTime', example='100'),
          totalTalkTime?: long(name='TotalTalkTime', example='100'),
          totalWorkTime?: long(name='TotalWorkTime', example='100'),
        }(name='Overall'),
        skillGroupId?: string(name='SkillGroupId', example='skillgroup1@ccc-test'),
        skillGroupName?: string(name='SkillGroupName', example='Default'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='11'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model ListHistoricalAgentSkillGroupReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListHistoricalAgentSkillGroupReportResponseBody(name='body'),
}

/**
 * @summary ListHistoricalAgentSkillGroupReport
 *
 * @param request ListHistoricalAgentSkillGroupReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListHistoricalAgentSkillGroupReportResponse
 */
async function listHistoricalAgentSkillGroupReportWithOptions(request: ListHistoricalAgentSkillGroupReportRequest, runtime: $RuntimeOptions): ListHistoricalAgentSkillGroupReportResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.skillGroupIdList)) {
    query['SkillGroupIdList'] = request.skillGroupIdList;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var body : map[string]any = {};
  if (!$isNull(request.agentIdList)) {
    body['AgentIdList'] = request.agentIdList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListHistoricalAgentSkillGroupReport',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary ListHistoricalAgentSkillGroupReport
 *
 * @param request ListHistoricalAgentSkillGroupReportRequest
 * @return ListHistoricalAgentSkillGroupReportResponse
 */
async function listHistoricalAgentSkillGroupReport(request: ListHistoricalAgentSkillGroupReportRequest): ListHistoricalAgentSkillGroupReportResponse {
  var runtime = new $RuntimeOptions{};
  return listHistoricalAgentSkillGroupReportWithOptions(request, runtime);
}

model ListHistoricalSkillGroupReportRequest {
  endTime?: long(name='EndTime', example='1532707199000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  mediaType?: string(name='MediaType'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='100'),
  skillGroupIdList?: string(name='SkillGroupIdList', example='["skillgroup1@ccc-test", "skillgroup2@ccc-test2"]'),
  startTime?: long(name='StartTime', example='1532448000000'),
}

model ListHistoricalSkillGroupReportResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        back2Back?: {
          agentHandleRate?: float(name='AgentHandleRate'),
          answerRate?: float(name='AnswerRate'),
          averageCustomerRingTime?: float(name='AverageCustomerRingTime'),
          averageRingTime?: float(name='AverageRingTime'),
          averageTalkTime?: float(name='AverageTalkTime'),
          callsAnswered?: long(name='CallsAnswered'),
          callsCustomerAnswered?: long(name='CallsCustomerAnswered'),
          callsDialed?: long(name='CallsDialed'),
          customerAnswerRate?: float(name='CustomerAnswerRate'),
          maxCustomerRingTime?: long(name='MaxCustomerRingTime'),
          maxRingTime?: long(name='MaxRingTime'),
          maxTalkTime?: long(name='MaxTalkTime'),
          totalCustomerRingTime?: long(name='TotalCustomerRingTime'),
          totalRingTime?: long(name='TotalRingTime'),
          totalTalkTime?: long(name='TotalTalkTime'),
        }(name='Back2Back'),
        inbound?: {
          abandonRate?: float(name='AbandonRate', example='0'),
          accessChannelTypeDetails?: [ 
            {
              accessChannelType?: string(name='AccessChannelType'),
              callsOffered?: long(name='CallsOffered'),
            }
          ](name='AccessChannelTypeDetails'),
          averageAbandonTime?: float(name='AverageAbandonTime', example='0'),
          averageAbandonedInQueueTime?: float(name='AverageAbandonedInQueueTime', example='0'),
          averageAbandonedInRingTime?: float(name='AverageAbandonedInRingTime', example='0'),
          averageFirstResponseTime?: float(name='AverageFirstResponseTime'),
          averageHoldTime?: float(name='AverageHoldTime', example='0'),
          averageResponseTime?: float(name='AverageResponseTime'),
          averageRingTime?: float(name='AverageRingTime', example='5'),
          averageTalkTime?: float(name='AverageTalkTime', example='64'),
          averageWaitTime?: float(name='AverageWaitTime', example='5'),
          averageWorkTime?: float(name='AverageWorkTime', example='13'),
          callsAbandoned?: long(name='CallsAbandoned', example='0'),
          callsAbandonedInQueue?: long(name='CallsAbandonedInQueue', example='0'),
          callsAbandonedInRing?: long(name='CallsAbandonedInRing', example='0'),
          callsAttendedTransferIn?: long(name='CallsAttendedTransferIn', example='0'),
          callsAttendedTransferOut?: long(name='CallsAttendedTransferOut', example='0'),
          callsBlindTransferIn?: long(name='CallsBlindTransferIn', example='0'),
          callsBlindTransferOut?: long(name='CallsBlindTransferOut', example='0'),
          callsHandled?: long(name='CallsHandled', example='7'),
          callsHold?: long(name='CallsHold', example='0'),
          callsOffered?: long(name='CallsOffered', example='7'),
          callsOverflow?: long(name='CallsOverflow', example='0'),
          callsQueued?: long(name='CallsQueued', example='7'),
          callsQueuingFailed?: long(name='CallsQueuingFailed'),
          callsQueuingOverflow?: long(name='CallsQueuingOverflow'),
          callsQueuingTimeout?: long(name='CallsQueuingTimeout'),
          callsRinged?: long(name='CallsRinged', example='7'),
          callsTimeout?: long(name='CallsTimeout', example='0'),
          handleRate?: float(name='HandleRate', example='1'),
          maxAbandonTime?: long(name='MaxAbandonTime', example='0'),
          maxAbandonedInQueueTime?: long(name='MaxAbandonedInQueueTime', example='0'),
          maxAbandonedInRingTime?: long(name='MaxAbandonedInRingTime', example='0'),
          maxHoldTime?: long(name='MaxHoldTime', example='0'),
          maxRingTime?: long(name='MaxRingTime', example='12'),
          maxTalkTime?: long(name='MaxTalkTime', example='0'),
          maxWaitTime?: long(name='MaxWaitTime', example='13'),
          maxWorkTime?: long(name='MaxWorkTime', example='12'),
          satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
          satisfactionRate?: float(name='SatisfactionRate', example='0'),
          satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
          satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
          serviceLevel15?: float(name='ServiceLevel15'),
          serviceLevel20?: float(name='ServiceLevel20', example='0'),
          serviceLevel30?: float(name='ServiceLevel30'),
          totalAbandonTime?: long(name='TotalAbandonTime', example='0'),
          totalAbandonedInQueueTime?: long(name='TotalAbandonedInQueueTime', example='0'),
          totalAbandonedInRingTime?: long(name='TotalAbandonedInRingTime', example='0'),
          totalHoldTime?: long(name='TotalHoldTime', example='0'),
          totalMessagesSent?: long(name='TotalMessagesSent'),
          totalMessagesSentByAgent?: long(name='TotalMessagesSentByAgent'),
          totalMessagesSentByCustomer?: long(name='TotalMessagesSentByCustomer'),
          totalRingTime?: long(name='TotalRingTime', example='32'),
          totalTalkTime?: long(name='TotalTalkTime', example='447'),
          totalWaitTime?: long(name='TotalWaitTime', example='34'),
          totalWorkTime?: long(name='TotalWorkTime', example='85'),
        }(name='Inbound'),
        outbound?: {
          answerRate?: float(name='AnswerRate', example='0'),
          averageDialingTime?: float(name='AverageDialingTime', example='37'),
          averageHoldTime?: float(name='AverageHoldTime', example='0'),
          averageRingTime?: float(name='AverageRingTime', example='0'),
          averageTalkTime?: float(name='AverageTalkTime', example='3'),
          averageWorkTime?: float(name='AverageWorkTime', example='2'),
          callsAnswered?: long(name='CallsAnswered', example='1'),
          callsAttendedTransferIn?: long(name='CallsAttendedTransferIn', example='0'),
          callsAttendedTransferOut?: long(name='CallsAttendedTransferOut', example='0'),
          callsBlindTransferIn?: long(name='CallsBlindTransferIn', example='0'),
          callsBlindTransferOut?: long(name='CallsBlindTransferOut', example='0'),
          callsDialed?: long(name='CallsDialed', example='6'),
          callsHold?: long(name='CallsHold', example='0'),
          callsRinged?: long(name='CallsRinged', example='0'),
          maxDialingTime?: long(name='MaxDialingTime', example='12'),
          maxHoldTime?: long(name='MaxHoldTime', example='0'),
          maxRingTime?: long(name='MaxRingTime', example='0'),
          maxTalkTime?: long(name='MaxTalkTime', example='0'),
          maxWorkTime?: long(name='MaxWorkTime', example='0'),
          satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
          satisfactionRate?: float(name='SatisfactionRate', example='0'),
          satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
          satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
          totalDialingTime?: long(name='TotalDialingTime', example='218'),
          totalHoldTime?: long(name='TotalHoldTime', example='0'),
          totalRingTime?: long(name='TotalRingTime', example='0'),
          totalTalkTime?: long(name='TotalTalkTime', example='3'),
          totalWorkTime?: long(name='TotalWorkTime', example='9'),
        }(name='Outbound'),
        overall?: {
          averageBreakTime?: float(name='AverageBreakTime', example='0'),
          averageHoldTime?: float(name='AverageHoldTime', example='0'),
          averageReadyTime?: float(name='AverageReadyTime', example='0'),
          averageTalkTime?: float(name='AverageTalkTime', example='0'),
          averageWorkTime?: float(name='AverageWorkTime', example='8'),
          breakCodeDetailList?: [ 
            {
              breakCode?: string(name='BreakCode'),
              count?: long(name='Count'),
              duration?: long(name='Duration'),
            }
          ](name='BreakCodeDetailList'),
          maxBreakTime?: long(name='MaxBreakTime', example='1'),
          maxHoldTime?: long(name='MaxHoldTime', example='0'),
          maxReadyTime?: long(name='MaxReadyTime', example='19328'),
          maxTalkTime?: long(name='MaxTalkTime', example='0'),
          maxWorkTime?: long(name='MaxWorkTime', example='12'),
          occupancyRate?: float(name='OccupancyRate', example='0.02332222293912065'),
          satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
          satisfactionRate?: float(name='SatisfactionRate', example='0'),
          satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
          satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
          totalBreakTime?: long(name='TotalBreakTime', example='3'),
          totalCalls?: long(name='TotalCalls', example='13'),
          totalHoldTime?: long(name='TotalHoldTime', example='0'),
          totalLoggedInTime?: long(name='TotalLoggedInTime', example='23218'),
          totalReadyTime?: long(name='TotalReadyTime', example='22428'),
          totalTalkTime?: long(name='TotalTalkTime', example='449'),
          totalWorkTime?: long(name='TotalWorkTime', example='94'),
        }(name='Overall'),
        skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
        skillGroupName?: string(name='SkillGroupName', example='skillgroup'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='100'),
    totalCount?: int32(name='TotalCount', example='4'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='26A34338-5CD9-4C95-A7A6-5BDCE76C6B94'),
}

model ListHistoricalSkillGroupReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListHistoricalSkillGroupReportResponseBody(name='body'),
}

/**
 * @param request ListHistoricalSkillGroupReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListHistoricalSkillGroupReportResponse
 */
async function listHistoricalSkillGroupReportWithOptions(request: ListHistoricalSkillGroupReportRequest, runtime: $RuntimeOptions): ListHistoricalSkillGroupReportResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var body : map[string]any = {};
  if (!$isNull(request.skillGroupIdList)) {
    body['SkillGroupIdList'] = request.skillGroupIdList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListHistoricalSkillGroupReport',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListHistoricalSkillGroupReportRequest
 * @return ListHistoricalSkillGroupReportResponse
 */
async function listHistoricalSkillGroupReport(request: ListHistoricalSkillGroupReportRequest): ListHistoricalSkillGroupReportResponse {
  var runtime = new $RuntimeOptions{};
  return listHistoricalSkillGroupReportWithOptions(request, runtime);
}

model ListInstancesRequest {
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
}

model ListInstancesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        adminList?: [ 
          {
            displayName?: string(name='DisplayName'),
            email?: string(name='Email', example='username@example.com'),
            extension?: string(name='Extension', example='8032****'),
            instanceId?: string(name='InstanceId', example='ccc-test'),
            loginName?: string(name='LoginName', example='agent'),
            mobile?: string(name='Mobile', example='1382114****'),
            roleId?: string(name='RoleId', example='Admin@ccc-test'),
            roleName?: string(name='RoleName', example='Admin'),
            userId?: string(name='UserId', example='agent@ccc-test'),
            workMode?: string(name='WorkMode', example='ON_SITE'),
          }
        ](name='AdminList'),
        aliyunUid?: string(name='AliyunUid', example='157123456789****'),
        consoleUrl?: string(name='ConsoleUrl', example='https://ccc-v2.aliyun.com/#/workbench/ccc-test'),
        createTime?: long(name='CreateTime', example='1624679747000'),
        description?: string(name='Description'),
        domainName?: string(name='DomainName', example='ccc-test'),
        id?: string(name='Id', example='ccc-test'),
        name?: string(name='Name'),
        numberList?: [ 
          {
            number?: string(name='Number', example='0830011****'),
          }
        ](name='NumberList'),
        status?: string(name='Status', example='RUNNING'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='10'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='26A34338-5CD9-4C95-A7A6-5BDCE76C6B94'),
}

model ListInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListInstancesResponseBody(name='body'),
}

/**
 * @param request ListInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListInstancesResponse
 */
async function listInstancesWithOptions(request: ListInstancesRequest, runtime: $RuntimeOptions): ListInstancesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListInstances',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListInstancesRequest
 * @return ListInstancesResponse
 */
async function listInstances(request: ListInstancesRequest): ListInstancesResponse {
  var runtime = new $RuntimeOptions{};
  return listInstancesWithOptions(request, runtime);
}

model ListInstancesOfUserRequest {
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
}

model ListInstancesOfUserResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        adminList?: [ 
          {
            displayName?: string(name='DisplayName'),
            email?: string(name='Email', example='username@example.com'),
            extension?: string(name='Extension', example='8032****'),
            instanceId?: string(name='InstanceId', example='ccc-test'),
            loginName?: string(name='LoginName', example='agent'),
            mobile?: string(name='Mobile', example='1382114****'),
            roleId?: string(name='RoleId', example='Admin@ccc-test'),
            roleName?: string(name='RoleName', example='Admin'),
            userId?: string(name='UserId', example='agent@ccc-test'),
            workMode?: string(name='WorkMode', example='ON_SITE'),
          }
        ](name='AdminList'),
        aliyunUid?: string(name='AliyunUid', example='157123456789****'),
        consoleUrl?: string(name='ConsoleUrl', example='https://ccc-v2.aliyun.com/#/workbench/ccc-test'),
        description?: string(name='Description'),
        domainName?: string(name='DomainName', example='ccc-test'),
        id?: string(name='Id', example='ccc-test'),
        name?: string(name='Name'),
        numberList?: [ 
          {
            active?: boolean(name='Active', example='true'),
            city?: string(name='City'),
            contactFlowId?: string(name='ContactFlowId', example='a3fb6c62-9b49-4942-ae5b-cf2abd4123ek'),
            instanceId?: string(name='InstanceId', example='ccc-test'),
            number?: string(name='Number', example='0830011****'),
            province?: string(name='Province'),
            skillGroups?: [ 
              {
                description?: string(name='Description'),
                displayName?: string(name='DisplayName'),
                instanceId?: string(name='InstanceId', example='ccc-test'),
                name?: string(name='Name', example='skillgroup'),
                phoneNumberCount?: int32(name='PhoneNumberCount', example='1'),
                skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
                userCount?: int32(name='UserCount', example='2'),
              }
            ](name='SkillGroups'),
            usage?: string(name='Usage', example='Bidirection'),
            userId?: string(name='UserId', example='agent@ccc-test'),
          }
        ](name='NumberList'),
        status?: string(name='Status', example='RUNNING'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='10'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='3969FC68-CEC2-4398-B76A-60D2F7EDEBAF'),
}

model ListInstancesOfUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListInstancesOfUserResponseBody(name='body'),
}

/**
 * @param request ListInstancesOfUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListInstancesOfUserResponse
 */
async function listInstancesOfUserWithOptions(request: ListInstancesOfUserRequest, runtime: $RuntimeOptions): ListInstancesOfUserResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListInstancesOfUser',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListInstancesOfUserRequest
 * @return ListInstancesOfUserResponse
 */
async function listInstancesOfUser(request: ListInstancesOfUserRequest): ListInstancesOfUserResponse {
  var runtime = new $RuntimeOptions{};
  return listInstancesOfUserWithOptions(request, runtime);
}

model ListIntervalAgentReportRequest {
  agentId?: string(name='AgentId', description='This parameter is required.', example='agent@ccc-test'),
  endTime?: long(name='EndTime', example='1532707199000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  interval?: string(name='Interval', example='Hourly'),
  mediaType?: string(name='MediaType'),
  startTime?: long(name='StartTime', example='1532448000000'),
}

model ListIntervalAgentReportResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      back2Back?: {
        agentHandleRate?: float(name='AgentHandleRate'),
        answerRate?: float(name='AnswerRate'),
        averageCustomerRingTime?: float(name='AverageCustomerRingTime'),
        averageRingTime?: float(name='AverageRingTime'),
        averageTalkTime?: float(name='AverageTalkTime'),
        callsAgentHandled?: long(name='CallsAgentHandled'),
        callsAnswered?: long(name='CallsAnswered'),
        callsCustomerAnswered?: long(name='CallsCustomerAnswered'),
        callsDialed?: long(name='CallsDialed'),
        customerAnswerRate?: float(name='CustomerAnswerRate'),
        maxCustomerRingTime?: long(name='MaxCustomerRingTime'),
        maxRingTime?: long(name='MaxRingTime'),
        maxTalkTime?: long(name='MaxTalkTime'),
        totalCustomerRingTime?: long(name='TotalCustomerRingTime'),
        totalRingTime?: long(name='TotalRingTime'),
        totalTalkTime?: long(name='TotalTalkTime'),
      }(name='Back2Back'),
      inbound?: {
        accessChannelTypeDetails?: [ 
          {
            accessChannelType?: string(name='AccessChannelType'),
            callsOffered?: long(name='CallsOffered'),
          }
        ](name='AccessChannelTypeDetails'),
        averageFirstResponseTime?: float(name='AverageFirstResponseTime'),
        averageHoldTime?: float(name='AverageHoldTime', example='0'),
        averageResponseTime?: float(name='AverageResponseTime'),
        averageRingTime?: float(name='AverageRingTime', example='0'),
        averageTalkTime?: float(name='AverageTalkTime', example='0'),
        averageWorkTime?: float(name='AverageWorkTime', example='0'),
        callsAttendedTransferIn?: long(name='CallsAttendedTransferIn', example='0'),
        callsAttendedTransferOut?: long(name='CallsAttendedTransferOut', example='0'),
        callsBlindTransferIn?: long(name='CallsBlindTransferIn', example='0'),
        callsBlindTransferOut?: long(name='CallsBlindTransferOut', example='0'),
        callsHandled?: long(name='CallsHandled', example='0'),
        callsHold?: long(name='CallsHold', example='0'),
        callsOffered?: long(name='CallsOffered', example='0'),
        callsRinged?: long(name='CallsRinged', example='0'),
        handleRate?: float(name='HandleRate', example='0'),
        maxHoldTime?: long(name='MaxHoldTime', example='0'),
        maxRingTime?: long(name='MaxRingTime', example='0'),
        maxTalkTime?: long(name='MaxTalkTime', example='0'),
        maxWorkTime?: long(name='MaxWorkTime', example='0'),
        satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
        satisfactionRate?: float(name='SatisfactionRate', example='0'),
        satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
        satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
        serviceLevel15?: float(name='ServiceLevel15'),
        totalHoldTime?: long(name='TotalHoldTime', example='0'),
        totalMessagesSent?: long(name='TotalMessagesSent'),
        totalMessagesSentByAgent?: long(name='TotalMessagesSentByAgent'),
        totalMessagesSentByCustomer?: long(name='TotalMessagesSentByCustomer'),
        totalRingTime?: long(name='TotalRingTime', example='0'),
        totalTalkTime?: long(name='TotalTalkTime', example='0'),
        totalWorkTime?: long(name='TotalWorkTime', example='0'),
      }(name='Inbound'),
      internal?: {
        averageTalkTime?: float(name='AverageTalkTime'),
        callsAnswered?: long(name='CallsAnswered'),
        callsDialed?: long(name='CallsDialed'),
        callsHandled?: long(name='CallsHandled'),
        callsOffered?: long(name='CallsOffered'),
        callsTalked?: long(name='CallsTalked'),
      }(name='Internal'),
      outbound?: {
        answerRate?: float(name='AnswerRate', example='0'),
        averageDialingTime?: float(name='AverageDialingTime', example='30'),
        averageHoldTime?: float(name='AverageHoldTime', example='0'),
        averageRingTime?: float(name='AverageRingTime', example='0'),
        averageTalkTime?: float(name='AverageTalkTime', example='0'),
        averageWorkTime?: float(name='AverageWorkTime', example='1'),
        callsAnswered?: long(name='CallsAnswered', example='0'),
        callsAttendedTransferIn?: long(name='CallsAttendedTransferIn', example='0'),
        callsAttendedTransferOut?: long(name='CallsAttendedTransferOut', example='0'),
        callsBlindTransferIn?: long(name='CallsBlindTransferIn', example='0'),
        callsBlindTransferOut?: long(name='CallsBlindTransferOut', example='0'),
        callsDialed?: long(name='CallsDialed', example='5'),
        callsHold?: long(name='CallsHold', example='0'),
        callsRinged?: long(name='CallsRinged', example='0'),
        maxDialingTime?: long(name='MaxDialingTime', example='60'),
        maxHoldTime?: long(name='MaxHoldTime', example='0'),
        maxRingTime?: long(name='MaxRingTime', example='0'),
        maxTalkTime?: long(name='MaxTalkTime', example='0'),
        maxWorkTime?: long(name='MaxWorkTime', example='2'),
        satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
        satisfactionRate?: float(name='SatisfactionRate', example='0'),
        satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
        satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
        totalDialingTime?: long(name='TotalDialingTime', example='148'),
        totalHoldTime?: long(name='TotalHoldTime', example='0'),
        totalRingTime?: long(name='TotalRingTime', example='0'),
        totalTalkTime?: long(name='TotalTalkTime', example='0'),
        totalWorkTime?: long(name='TotalWorkTime', example='4'),
      }(name='Outbound'),
      overall?: {
        averageBreakTime?: float(name='AverageBreakTime', example='0'),
        averageHoldTime?: float(name='AverageHoldTime', example='0'),
        averageReadyTime?: float(name='AverageReadyTime', example='0'),
        averageTalkTime?: float(name='AverageTalkTime', example='0'),
        averageWorkTime?: float(name='AverageWorkTime', example='1'),
        breakCodeDetailList?: [ 
          {
            breakCode?: string(name='BreakCode'),
            count?: long(name='Count'),
            duration?: long(name='Duration'),
          }
        ](name='BreakCodeDetailList'),
        firstCheckInTime?: long(name='FirstCheckInTime', example='0'),
        lastCheckOutTime?: long(name='LastCheckOutTime'),
        lastCheckoutTime?: long(name='LastCheckoutTime', example='0'),
        maxBreakTime?: long(name='MaxBreakTime', example='1'),
        maxHoldTime?: long(name='MaxHoldTime', example='0'),
        maxReadyTime?: long(name='MaxReadyTime', example='435'),
        maxTalkTime?: long(name='MaxTalkTime', example='0'),
        maxWorkTime?: long(name='MaxWorkTime', example='2'),
        occupancyRate?: float(name='OccupancyRate', example='0'),
        satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
        satisfactionRate?: float(name='SatisfactionRate', example='0'),
        satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
        satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
        totalBreakTime?: long(name='TotalBreakTime', example='1'),
        totalCalls?: long(name='TotalCalls', example='5'),
        totalHoldTime?: long(name='TotalHoldTime', example='0'),
        totalLoggedInTime?: long(name='TotalLoggedInTime', example='914'),
        totalOffSiteLoggedInTime?: long(name='TotalOffSiteLoggedInTime'),
        totalOffSiteOnlineTime?: long(name='TotalOffSiteOnlineTime', example='已弃用，请使用TotalOffSiteLoggedInTime代替此参数'),
        totalOfficePhoneLoggedInTime?: long(name='TotalOfficePhoneLoggedInTime'),
        totalOfficePhoneOnlineTime?: long(name='TotalOfficePhoneOnlineTime', example='已弃用，请使用TotalOfficePhoneLoggedInTime代替此参数'),
        totalOnSiteLoggedInTime?: long(name='TotalOnSiteLoggedInTime'),
        totalOnSiteOnlineTime?: long(name='TotalOnSiteOnlineTime', example='已弃用，请使用TotalOnSiteLoggedInTime代替此参数'),
        totalOutboundScenarioLoggedInTime?: long(name='TotalOutboundScenarioLoggedInTime'),
        totalOutboundScenarioReadyTime?: long(name='TotalOutboundScenarioReadyTime'),
        totalOutboundScenarioTime?: long(name='TotalOutboundScenarioTime', example='已弃用，请使用TotalOutboundScenarioLoggedInTime代替此参数'),
        totalReadyTime?: long(name='TotalReadyTime', example='763'),
        totalTalkTime?: long(name='TotalTalkTime', example='0'),
        totalWorkTime?: long(name='TotalWorkTime', example='4'),
      }(name='Overall'),
      statsTime?: long(name='StatsTime', example='1620291600000'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='943D8EF3-3321-471F-A104-51C96FCA94D6'),
}

model ListIntervalAgentReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIntervalAgentReportResponseBody(name='body'),
}

/**
 * @param request ListIntervalAgentReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIntervalAgentReportResponse
 */
async function listIntervalAgentReportWithOptions(request: ListIntervalAgentReportRequest, runtime: $RuntimeOptions): ListIntervalAgentReportResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentId)) {
    query['AgentId'] = request.agentId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListIntervalAgentReport',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListIntervalAgentReportRequest
 * @return ListIntervalAgentReportResponse
 */
async function listIntervalAgentReport(request: ListIntervalAgentReportRequest): ListIntervalAgentReportResponse {
  var runtime = new $RuntimeOptions{};
  return listIntervalAgentReportWithOptions(request, runtime);
}

model ListIntervalAgentSkillGroupReportRequest {
  agentId?: string(name='AgentId', description='This parameter is required.', example='agent@ccc-test'),
  endTime?: long(name='EndTime', example='1558443508000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  interval?: string(name='Interval', example='Daily'),
  skillGroupId?: string(name='SkillGroupId', description='This parameter is required.', example='skg-default@ccc-test'),
  startTime?: long(name='StartTime', example='1532448000000'),
}

model ListIntervalAgentSkillGroupReportResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      back2Back?: {
        agentAnswerRate?: float(name='AgentAnswerRate', example='100'),
        agentHandleRate?: float(name='AgentHandleRate'),
        answerRate?: float(name='AnswerRate', example='0.5'),
        averageCustomerRingTime?: float(name='AverageCustomerRingTime', example='100'),
        averageRingTime?: float(name='AverageRingTime', example='100'),
        averageTalkTime?: long(name='AverageTalkTime', example='100'),
        callsAgentHandled?: long(name='CallsAgentHandled'),
        callsAnswered?: long(name='CallsAnswered', example='100'),
        callsCustomerAnswered?: long(name='CallsCustomerAnswered'),
        callsCustomerHandled?: long(name='CallsCustomerHandled', example='100'),
        callsDialed?: long(name='CallsDialed', example='100'),
        customerAnswerRate?: float(name='CustomerAnswerRate'),
        customerHandleRate?: float(name='CustomerHandleRate', example='100'),
        maxCustomerRingTime?: long(name='MaxCustomerRingTime', example='100'),
        maxRingTime?: long(name='MaxRingTime', example='100'),
        maxTalkTime?: long(name='MaxTalkTime', example='100'),
        totalCustomerRingTime?: long(name='TotalCustomerRingTime', example='100'),
        totalRingTime?: long(name='TotalRingTime', example='100'),
        totalTalkTime?: long(name='TotalTalkTime', example='100'),
      }(name='Back2Back'),
      inbound?: {
        averageFirstResponseTime?: float(name='AverageFirstResponseTime'),
        averageHoldTime?: float(name='AverageHoldTime', example='100'),
        averageResponseTime?: float(name='AverageResponseTime'),
        averageRingTime?: float(name='AverageRingTime', example='11'),
        averageTalkTime?: float(name='AverageTalkTime', example='100'),
        averageWorkTime?: float(name='AverageWorkTime', example='100'),
        callsAttendedTransferIn?: long(name='CallsAttendedTransferIn', example='100'),
        callsAttendedTransferOut?: long(name='CallsAttendedTransferOut', example='10'),
        callsBlindTransferIn?: long(name='CallsBlindTransferIn', example='100'),
        callsBlindTransferOut?: long(name='CallsBlindTransferOut', example='100'),
        callsHandled?: long(name='CallsHandled', example='7'),
        callsHold?: long(name='CallsHold', example='100'),
        callsOffered?: long(name='CallsOffered', example='100'),
        callsRinged?: long(name='CallsRinged', example='100'),
        handleRate?: float(name='HandleRate', example='0.5'),
        maxHoldTime?: long(name='MaxHoldTime', example='100'),
        maxRingTime?: long(name='MaxRingTime', example='100'),
        maxTalkTime?: long(name='MaxTalkTime', example='100'),
        maxWorkTime?: long(name='MaxWorkTime', example='100'),
        satisfactionIndex?: float(name='SatisfactionIndex', example='100'),
        satisfactionRate?: float(name='SatisfactionRate', example='0.5'),
        satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='100'),
        satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='100'),
        totalHoldTime?: long(name='TotalHoldTime', example='100'),
        totalMessagesSent?: long(name='TotalMessagesSent'),
        totalMessagesSentByAgent?: long(name='TotalMessagesSentByAgent'),
        totalMessagesSentByCustomer?: long(name='TotalMessagesSentByCustomer'),
        totalRingTime?: long(name='TotalRingTime', example='100'),
        totalTalkTime?: long(name='TotalTalkTime', example='100'),
        totalWorkTime?: long(name='TotalWorkTime', example='85'),
      }(name='Inbound'),
      internal?: {
        averageTalkTime?: float(name='AverageTalkTime', example='100'),
        callsAnswered?: long(name='CallsAnswered', example='100'),
        callsDialed?: long(name='CallsDialed', example='100'),
        callsHandled?: long(name='CallsHandled', example='100'),
        callsOffered?: long(name='CallsOffered', example='100'),
        callsTalk?: long(name='CallsTalk', example='100'),
        callsTalked?: long(name='CallsTalked'),
        maxTalkTime?: long(name='MaxTalkTime', example='100'),
        totalTalkTime?: long(name='TotalTalkTime', example='100'),
      }(name='Internal'),
      outbound?: {
        answerRate?: float(name='AnswerRate', example='0.5'),
        averageDialingTime?: float(name='AverageDialingTime', example='100'),
        averageHoldTime?: float(name='AverageHoldTime', example='100'),
        averageRingTime?: float(name='AverageRingTime', example='100'),
        averageTalkTime?: float(name='AverageTalkTime', example='100'),
        averageWorkTime?: float(name='AverageWorkTime', example='100'),
        callsAnswered?: long(name='CallsAnswered', example='100'),
        callsAttendedTransferIn?: long(name='CallsAttendedTransferIn', example='100'),
        callsAttendedTransferOut?: long(name='CallsAttendedTransferOut', example='100'),
        callsBlindTransferIn?: long(name='CallsBlindTransferIn', example='100'),
        callsBlindTransferOut?: long(name='CallsBlindTransferOut', example='100'),
        callsDialed?: long(name='CallsDialed', example='100'),
        callsHold?: long(name='CallsHold', example='100'),
        callsRinged?: long(name='CallsRinged', example='100'),
        maxDialingTime?: long(name='MaxDialingTime', example='100'),
        maxHoldTime?: long(name='MaxHoldTime', example='100'),
        maxRingTime?: long(name='MaxRingTime', example='100'),
        maxTalkTime?: long(name='MaxTalkTime', example='0'),
        maxWorkTime?: long(name='MaxWorkTime', example='100'),
        satisfactionIndex?: float(name='SatisfactionIndex', example='100'),
        satisfactionRate?: float(name='SatisfactionRate', example='100'),
        satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='100'),
        satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='100'),
        totalDialingTime?: long(name='TotalDialingTime', example='100'),
        totalHoldTime?: long(name='TotalHoldTime', example='100'),
        totalRingTime?: long(name='TotalRingTime', example='100'),
        totalTalkTime?: long(name='TotalTalkTime', example='100'),
        totalWorkTime?: long(name='TotalWorkTime', example='100'),
      }(name='Outbound'),
      overall?: {
        averageBreakTime?: float(name='AverageBreakTime', example='100'),
        averageHoldTime?: float(name='AverageHoldTime', example='100'),
        averageReadyTime?: float(name='AverageReadyTime', example='100'),
        averageTalkTime?: float(name='AverageTalkTime', example='100'),
        averageWorkTime?: float(name='AverageWorkTime', example='100'),
        breakCodeDetailList?: [ 
          {
            breakCode?: string(name='BreakCode'),
            count?: long(name='Count', example='1'),
            duration?: long(name='Duration', example='100'),
          }
        ](name='BreakCodeDetailList'),
        firstCheckInTime?: long(name='FirstCheckInTime', example='100'),
        lastCheckOutTime?: long(name='LastCheckOutTime'),
        lastCheckoutTime?: long(name='LastCheckoutTime', example='100'),
        maxBreakTime?: long(name='MaxBreakTime', example='100'),
        maxHoldTime?: long(name='MaxHoldTime', example='100'),
        maxReadyTime?: long(name='MaxReadyTime', example='100'),
        maxTalkTime?: long(name='MaxTalkTime', example='100'),
        maxWorkTime?: long(name='MaxWorkTime', example='100'),
        occupancyRate?: float(name='OccupancyRate', example='0.4'),
        satisfactionIndex?: float(name='SatisfactionIndex', example='1.4'),
        satisfactionRate?: float(name='SatisfactionRate', example='100'),
        satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='100'),
        satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='100'),
        totalBreakTime?: long(name='TotalBreakTime', example='100'),
        totalCalls?: long(name='TotalCalls', example='100'),
        totalHoldTime?: long(name='TotalHoldTime', example='100'),
        totalLoggedInTime?: long(name='TotalLoggedInTime', example='100'),
        totalOffSiteLoggedInTime?: string(name='TotalOffSiteLoggedInTime'),
        totalOfficePhoneLoggedInTime?: string(name='TotalOfficePhoneLoggedInTime'),
        totalOnSiteLoggedInTime?: string(name='TotalOnSiteLoggedInTime'),
        totalOutboundScenarioLoggedInTime?: long(name='TotalOutboundScenarioLoggedInTime'),
        totalOutboundScenarioReadyTime?: long(name='TotalOutboundScenarioReadyTime', example='100'),
        totalOutboundScenarioTime?: long(name='TotalOutboundScenarioTime', example='100'),
        totalReadyTime?: long(name='TotalReadyTime', example='100'),
        totalTalkTime?: long(name='TotalTalkTime', example='100'),
        totalWorkTime?: long(name='TotalWorkTime', example='100'),
      }(name='Overall'),
      statsTime?: long(name='StatsTime', example='1620291600000'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='2778FA12-EDD6-42AA-9B15-AF855072E5E5'),
}

model ListIntervalAgentSkillGroupReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIntervalAgentSkillGroupReportResponseBody(name='body'),
}

/**
 * @summary ListIntervalAgentSkillGroupReport
 *
 * @param request ListIntervalAgentSkillGroupReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIntervalAgentSkillGroupReportResponse
 */
async function listIntervalAgentSkillGroupReportWithOptions(request: ListIntervalAgentSkillGroupReportRequest, runtime: $RuntimeOptions): ListIntervalAgentSkillGroupReportResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListIntervalAgentSkillGroupReport',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary ListIntervalAgentSkillGroupReport
 *
 * @param request ListIntervalAgentSkillGroupReportRequest
 * @return ListIntervalAgentSkillGroupReportResponse
 */
async function listIntervalAgentSkillGroupReport(request: ListIntervalAgentSkillGroupReportRequest): ListIntervalAgentSkillGroupReportResponse {
  var runtime = new $RuntimeOptions{};
  return listIntervalAgentSkillGroupReportWithOptions(request, runtime);
}

model ListIntervalInstanceReportRequest {
  endTime?: long(name='EndTime', example='1620316799000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  interval?: string(name='Interval', example='Hourly'),
  startTime?: long(name='StartTime', example='1620230400000'),
}

model ListIntervalInstanceReportResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      inbound?: {
        abandonRate?: float(name='AbandonRate'),
        abandonedRate?: float(name='AbandonedRate', example='0'),
        averageAbandonTime?: float(name='AverageAbandonTime', example='0'),
        averageAbandonedInIVRTime?: float(name='AverageAbandonedInIVRTime', example='0'),
        averageAbandonedInQueueTime?: float(name='AverageAbandonedInQueueTime', example='0'),
        averageAbandonedInRingTime?: float(name='AverageAbandonedInRingTime', example='0'),
        averageFirstResponseTime?: float(name='AverageFirstResponseTime'),
        averageHoldTime?: float(name='AverageHoldTime', example='0'),
        averageResponseTime?: float(name='AverageResponseTime'),
        averageRingTime?: float(name='AverageRingTime', example='5'),
        averageTalkTime?: float(name='AverageTalkTime', example='64'),
        averageWaitTime?: float(name='AverageWaitTime', example='5'),
        averageWorkTime?: float(name='AverageWorkTime', example='13'),
        callsAbandoned?: long(name='CallsAbandoned', example='0'),
        callsAbandonedInIVR?: long(name='CallsAbandonedInIVR', example='0'),
        callsAbandonedInQueue?: long(name='CallsAbandonedInQueue', example='0'),
        callsAbandonedInRing?: long(name='CallsAbandonedInRing', example='0'),
        callsAbandonedInVoiceNavigator?: long(name='CallsAbandonedInVoiceNavigator', example='0'),
        callsAttendedTransferred?: long(name='CallsAttendedTransferred', example='0'),
        callsBlindTransferred?: long(name='CallsBlindTransferred', example='0'),
        callsCausedIVRException?: long(name='CallsCausedIVRException'),
        callsForwardToOutsideNumber?: long(name='CallsForwardToOutsideNumber', example='0'),
        callsHandled?: long(name='CallsHandled', example='7'),
        callsHold?: long(name='CallsHold', example='0'),
        callsIVRException?: long(name='CallsIVRException', example='0'),
        callsOffered?: long(name='CallsOffered', example='7'),
        callsQueued?: long(name='CallsQueued', example='7'),
        callsQueuingFailed?: long(name='CallsQueuingFailed', example='0'),
        callsQueuingOverflow?: long(name='CallsQueuingOverflow', example='0'),
        callsQueuingTimeout?: long(name='CallsQueuingTimeout', example='0'),
        callsRinged?: long(name='CallsRinged', example='7'),
        callsToVoicemail?: long(name='CallsToVoicemail'),
        callsVoicemail?: long(name='CallsVoicemail', example='0'),
        handleRate?: float(name='HandleRate', example='1'),
        maxAbandonTime?: long(name='MaxAbandonTime', example='0'),
        maxAbandonedInIVRTime?: long(name='MaxAbandonedInIVRTime', example='0'),
        maxAbandonedInQueueTime?: long(name='MaxAbandonedInQueueTime', example='0'),
        maxAbandonedInRingTime?: long(name='MaxAbandonedInRingTime', example='0'),
        maxHoldTime?: long(name='MaxHoldTime', example='0'),
        maxRingTime?: long(name='MaxRingTime', example='12'),
        maxTalkTime?: long(name='MaxTalkTime', example='219'),
        maxWaitTime?: long(name='MaxWaitTime', example='13'),
        maxWorkTime?: long(name='MaxWorkTime', example='17'),
        satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
        satisfactionRate?: float(name='SatisfactionRate', example='0'),
        satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
        satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
        serviceLevel20?: float(name='ServiceLevel20', example='1'),
        totalAbandonTime?: long(name='TotalAbandonTime', example='0'),
        totalAbandonedInIVRTime?: long(name='TotalAbandonedInIVRTime', example='0'),
        totalAbandonedInQueueTime?: long(name='TotalAbandonedInQueueTime', example='0'),
        totalAbandonedInRingTime?: long(name='TotalAbandonedInRingTime', example='0'),
        totalHoldTime?: long(name='TotalHoldTime', example='0'),
        totalMessagesSent?: long(name='TotalMessagesSent'),
        totalMessagesSentByAgent?: long(name='TotalMessagesSentByAgent'),
        totalMessagesSentByCustomer?: long(name='TotalMessagesSentByCustomer'),
        totalRingTime?: long(name='TotalRingTime', example='32'),
        totalTalkTime?: long(name='TotalTalkTime', example='447'),
        totalWaitTime?: long(name='TotalWaitTime', example='34'),
        totalWorkTime?: long(name='TotalWorkTime', example='85'),
      }(name='Inbound'),
      outbound?: {
        answerRate?: float(name='AnswerRate', example='0'),
        averageDialingTime?: float(name='AverageDialingTime', example='0'),
        averageHoldTime?: float(name='AverageHoldTime', example='0'),
        averageRingTime?: float(name='AverageRingTime', example='0'),
        averageTalkTime?: float(name='AverageTalkTime', example='0'),
        averageWorkTime?: float(name='AverageWorkTime', example='0'),
        callsAnswered?: long(name='CallsAnswered', example='0'),
        callsAttendedTransferred?: long(name='CallsAttendedTransferred', example='0'),
        callsBlindTransferred?: long(name='CallsBlindTransferred', example='0'),
        callsDialed?: long(name='CallsDialed', example='0'),
        callsHold?: long(name='CallsHold', example='0'),
        callsRinged?: long(name='CallsRinged', example='0'),
        maxDialingTime?: long(name='MaxDialingTime', example='0'),
        maxHoldTime?: long(name='MaxHoldTime', example='0'),
        maxRingTime?: long(name='MaxRingTime', example='0'),
        maxTalkTime?: long(name='MaxTalkTime', example='0'),
        maxWorkTime?: long(name='MaxWorkTime', example='0'),
        satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
        satisfactionRate?: float(name='SatisfactionRate', example='0'),
        satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
        satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
        totalDialingTime?: long(name='TotalDialingTime', example='0'),
        totalHoldTime?: long(name='TotalHoldTime', example='0'),
        totalRingTime?: long(name='TotalRingTime', example='0'),
        totalTalkTime?: long(name='TotalTalkTime', example='0'),
        totalWorkTime?: long(name='TotalWorkTime', example='0'),
      }(name='Outbound'),
      overall?: {
        averageBreakTime?: float(name='AverageBreakTime', example='0'),
        averageHoldTime?: float(name='AverageHoldTime', example='0'),
        averageReadyTime?: float(name='AverageReadyTime', example='0'),
        averageTalkTime?: float(name='AverageTalkTime', example='0'),
        averageWorkTime?: float(name='AverageWorkTime', example='0'),
        maxBreakTime?: long(name='MaxBreakTime', example='0'),
        maxHoldTime?: long(name='MaxHoldTime', example='0'),
        maxReadyTime?: long(name='MaxReadyTime', example='0'),
        maxTalkTime?: long(name='MaxTalkTime', example='0'),
        maxWorkTime?: long(name='MaxWorkTime', example='0'),
        occupancyRate?: float(name='OccupancyRate', example='0'),
        satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
        satisfactionRate?: float(name='SatisfactionRate', example='0'),
        satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
        satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
        totalBreakTime?: long(name='TotalBreakTime', example='0'),
        totalCalls?: long(name='TotalCalls', example='0'),
        totalHoldTime?: long(name='TotalHoldTime', example='0'),
        totalLoggedInTime?: long(name='TotalLoggedInTime', example='0'),
        totalReadyTime?: long(name='TotalReadyTime', example='0'),
        totalTalkTime?: long(name='TotalTalkTime', example='0'),
        totalWorkTime?: long(name='TotalWorkTime', example='0'),
      }(name='Overall'),
      statsTime?: long(name='StatsTime', example='1620230400000'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='943D8EF3-3321-471F-A104-51C96FCA94D6'),
}

model ListIntervalInstanceReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIntervalInstanceReportResponseBody(name='body'),
}

/**
 * @param request ListIntervalInstanceReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIntervalInstanceReportResponse
 */
async function listIntervalInstanceReportWithOptions(request: ListIntervalInstanceReportRequest, runtime: $RuntimeOptions): ListIntervalInstanceReportResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListIntervalInstanceReport',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListIntervalInstanceReportRequest
 * @return ListIntervalInstanceReportResponse
 */
async function listIntervalInstanceReport(request: ListIntervalInstanceReportRequest): ListIntervalInstanceReportResponse {
  var runtime = new $RuntimeOptions{};
  return listIntervalInstanceReportWithOptions(request, runtime);
}

model ListIntervalSkillGroupReportRequest {
  endTime?: long(name='EndTime', example='1604725528000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  interval?: string(name='Interval', example='Hourly'),
  mediaType?: string(name='MediaType'),
  skillGroupId?: string(name='SkillGroupId', description='This parameter is required.', example='skg-default@ccc-test'),
  startTime?: long(name='StartTime', example='1604639129000'),
}

model ListIntervalSkillGroupReportResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      back2Back?: {
        agentHandleRate?: float(name='AgentHandleRate'),
        answerRate?: string(name='AnswerRate'),
        averageCustomerRingTime?: float(name='AverageCustomerRingTime'),
        averageRingTime?: float(name='AverageRingTime'),
        averageTalkTime?: string(name='AverageTalkTime'),
        callsAgentHandled?: long(name='CallsAgentHandled'),
        callsAnswered?: long(name='CallsAnswered'),
        callsCustomerAnswered?: long(name='CallsCustomerAnswered'),
        callsDialed?: long(name='CallsDialed'),
        customerAnswerRate?: float(name='CustomerAnswerRate'),
        maxCustomerRingTime?: long(name='MaxCustomerRingTime'),
        maxRingTime?: long(name='MaxRingTime'),
        maxTalkTime?: string(name='MaxTalkTime'),
        totalCustomerRingTime?: long(name='TotalCustomerRingTime'),
        totalRingTime?: long(name='TotalRingTime'),
        totalTalkTime?: long(name='TotalTalkTime'),
      }(name='Back2Back'),
      inbound?: {
        abandonRate?: float(name='AbandonRate', example='0'),
        averageAbandonTime?: float(name='AverageAbandonTime', example='0'),
        averageAbandonedInQueueTime?: float(name='AverageAbandonedInQueueTime', example='0'),
        averageAbandonedInRingTime?: float(name='AverageAbandonedInRingTime', example='0'),
        averageFirstResponseTime?: float(name='AverageFirstResponseTime'),
        averageHoldTime?: float(name='AverageHoldTime', example='0'),
        averageResponseTime?: float(name='AverageResponseTime'),
        averageRingTime?: float(name='AverageRingTime', example='11'),
        averageTalkTime?: float(name='AverageTalkTime', example='5'),
        averageWaitTime?: float(name='AverageWaitTime', example='11'),
        averageWorkTime?: float(name='AverageWorkTime', example='8'),
        callsAbandoned?: long(name='CallsAbandoned', example='0'),
        callsAbandonedInQueue?: long(name='CallsAbandonedInQueue', example='0'),
        callsAbandonedInRing?: long(name='CallsAbandonedInRing', example='0'),
        callsAttendedTransferIn?: long(name='CallsAttendedTransferIn', example='0'),
        callsAttendedTransferOut?: long(name='CallsAttendedTransferOut', example='0'),
        callsBlindTransferIn?: long(name='CallsBlindTransferIn', example='0'),
        callsBlindTransferOut?: long(name='CallsBlindTransferOut', example='0'),
        callsHandled?: long(name='CallsHandled', example='2'),
        callsHold?: long(name='CallsHold', example='0'),
        callsOffered?: long(name='CallsOffered', example='3'),
        callsOverflow?: long(name='CallsOverflow', example='0'),
        callsQueued?: long(name='CallsQueued', example='3'),
        callsQueuingOverflow?: long(name='CallsQueuingOverflow'),
        callsQueuingTimeout?: long(name='CallsQueuingTimeout'),
        callsRinged?: long(name='CallsRinged', example='3'),
        callsTimeout?: long(name='CallsTimeout', example='0'),
        handleRate?: float(name='HandleRate', example='0.6666666666666666'),
        maxAbandonTime?: long(name='MaxAbandonTime', example='0'),
        maxAbandonedInQueueTime?: long(name='MaxAbandonedInQueueTime', example='0'),
        maxAbandonedInRingTime?: long(name='MaxAbandonedInRingTime', example='0'),
        maxHoldTime?: long(name='MaxHoldTime', example='0'),
        maxRingTime?: long(name='MaxRingTime', example='18'),
        maxTalkTime?: long(name='MaxTalkTime', example='6'),
        maxWaitTime?: long(name='MaxWaitTime', example='18'),
        maxWorkTime?: long(name='MaxWorkTime', example='19'),
        satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
        satisfactionRate?: float(name='SatisfactionRate', example='0'),
        satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
        satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
        serviceLevel20?: float(name='ServiceLevel20', example='0'),
        totalAbandonTime?: long(name='TotalAbandonTime', example='0'),
        totalAbandonedInQueueTime?: long(name='TotalAbandonedInQueueTime', example='0'),
        totalAbandonedInRingTime?: long(name='TotalAbandonedInRingTime', example='0'),
        totalHoldTime?: long(name='TotalHoldTime', example='0'),
        totalMessagesSent?: long(name='TotalMessagesSent'),
        totalMessagesSentByAgent?: long(name='TotalMessagesSentByAgent'),
        totalMessagesSentByCustomer?: long(name='TotalMessagesSentByCustomer'),
        totalRingTime?: long(name='TotalRingTime', example='33'),
        totalTalkTime?: long(name='TotalTalkTime', example='9'),
        totalWaitTime?: long(name='TotalWaitTime', example='33'),
        totalWorkTime?: long(name='TotalWorkTime', example='23'),
      }(name='Inbound'),
      outbound?: {
        answerRate?: float(name='AnswerRate', example='0'),
        averageDialingTime?: float(name='AverageDialingTime', example='30'),
        averageHoldTime?: float(name='AverageHoldTime', example='0'),
        averageRingTime?: float(name='AverageRingTime', example='0'),
        averageTalkTime?: float(name='AverageTalkTime', example='5'),
        averageWorkTime?: float(name='AverageWorkTime', example='3'),
        callsAnswered?: long(name='CallsAnswered', example='1'),
        callsAttendedTransferIn?: long(name='CallsAttendedTransferIn', example='0'),
        callsAttendedTransferOut?: long(name='CallsAttendedTransferOut', example='0'),
        callsBlindTransferIn?: long(name='CallsBlindTransferIn', example='0'),
        callsBlindTransferOut?: long(name='CallsBlindTransferOut', example='0'),
        callsDialed?: long(name='CallsDialed', example='2'),
        callsHold?: long(name='CallsHold', example='0'),
        callsRinged?: long(name='CallsRinged', example='0'),
        maxDialingTime?: long(name='MaxDialingTime', example='49'),
        maxHoldTime?: long(name='MaxHoldTime', example='0'),
        maxRingTime?: long(name='MaxRingTime', example='0'),
        maxTalkTime?: long(name='MaxTalkTime', example='5'),
        maxWorkTime?: long(name='MaxWorkTime', example='4'),
        satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
        satisfactionRate?: float(name='SatisfactionRate', example='0'),
        satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
        satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
        totalDialingTime?: long(name='TotalDialingTime', example='60'),
        totalHoldTime?: long(name='TotalHoldTime', example='0'),
        totalRingTime?: long(name='TotalRingTime', example='0'),
        totalTalkTime?: long(name='TotalTalkTime', example='5'),
        totalWorkTime?: long(name='TotalWorkTime', example='5'),
      }(name='Outbound'),
      overall?: {
        averageBreakTime?: float(name='AverageBreakTime', example='0'),
        averageHoldTime?: float(name='AverageHoldTime', example='0'),
        averageReadyTime?: float(name='AverageReadyTime', example='0'),
        averageTalkTime?: float(name='AverageTalkTime', example='0'),
        averageWorkTime?: float(name='AverageWorkTime', example='6'),
        breakCodeDetailList?: [ 
          {
            breakCode?: string(name='BreakCode'),
            count?: long(name='Count'),
            duration?: long(name='Duration'),
          }
        ](name='BreakCodeDetailList'),
        maxBreakTime?: long(name='MaxBreakTime', example='1'),
        maxHoldTime?: long(name='MaxHoldTime', example='0'),
        maxReadyTime?: long(name='MaxReadyTime', example='4927'),
        maxTalkTime?: long(name='MaxTalkTime', example='6'),
        maxWorkTime?: long(name='MaxWorkTime', example='19'),
        occupancyRate?: float(name='OccupancyRate', example='0.00422315148470254'),
        satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
        satisfactionRate?: float(name='SatisfactionRate', example='0'),
        satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
        satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
        totalBreakTime?: long(name='TotalBreakTime', example='5'),
        totalCalls?: long(name='TotalCalls', example='5'),
        totalHoldTime?: long(name='TotalHoldTime', example='0'),
        totalLoggedInTime?: long(name='TotalLoggedInTime', example='9236'),
        totalReadyTime?: long(name='TotalReadyTime', example='9106'),
        totalTalkTime?: long(name='TotalTalkTime', example='13'),
        totalWorkTime?: long(name='TotalWorkTime', example='27'),
      }(name='Overall'),
      statsTime?: long(name='StatsTime', example='1604639129000'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='943D8EF3-3321-471F-A104-51C96FCA94D6'),
}

model ListIntervalSkillGroupReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIntervalSkillGroupReportResponseBody(name='body'),
}

/**
 * @param request ListIntervalSkillGroupReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIntervalSkillGroupReportResponse
 */
async function listIntervalSkillGroupReportWithOptions(request: ListIntervalSkillGroupReportRequest, runtime: $RuntimeOptions): ListIntervalSkillGroupReportResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListIntervalSkillGroupReport',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListIntervalSkillGroupReportRequest
 * @return ListIntervalSkillGroupReportResponse
 */
async function listIntervalSkillGroupReport(request: ListIntervalSkillGroupReportRequest): ListIntervalSkillGroupReportResponse {
  var runtime = new $RuntimeOptions{};
  return listIntervalSkillGroupReportWithOptions(request, runtime);
}

model ListIvrTrackingDetailsRequest {
  contactId?: string(name='ContactId', description='This parameter is required.', example='job-10963442671187****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
}

model ListIvrTrackingDetailsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        callee?: string(name='Callee', example='0533128****'),
        caller?: string(name='Caller', example='1332315****'),
        channelId?: string(name='ChannelId', example='65cp2c15-92ac-4e67-98b2-073a3c541c5d'),
        channelVariables?: string(name='ChannelVariables', example='A=B;C=D'),
        contactId?: string(name='ContactId', example='job-10963442671187****'),
        enterTime?: long(name='EnterTime', example='1621910542876'),
        flowId?: string(name='FlowId', example='abc99462-1058-47d0-a114-f145ea7444ff'),
        flowName?: string(name='FlowName'),
        instance?: string(name='Instance', example='ccc-test'),
        leaveTime?: long(name='LeaveTime', example='1621910545105'),
        nodeExitCode?: string(name='NodeExitCode', example='Success'),
        nodeId?: string(name='NodeId', example='e0bc19a3'),
        nodeName?: string(name='NodeName'),
        nodeProperties?: map[string]any(name='NodeProperties'),
        nodeType?: string(name='NodeType', example='PLAY_OR_SAY'),
        nodeVariables?: map[string]any(name='NodeVariables', example='{"digits":"2"}'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='3'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='D2RB671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ListIvrTrackingDetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIvrTrackingDetailsResponseBody(name='body'),
}

/**
 * @param request ListIvrTrackingDetailsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIvrTrackingDetailsResponse
 */
async function listIvrTrackingDetailsWithOptions(request: ListIvrTrackingDetailsRequest, runtime: $RuntimeOptions): ListIvrTrackingDetailsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactId)) {
    query['ContactId'] = request.contactId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListIvrTrackingDetails',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListIvrTrackingDetailsRequest
 * @return ListIvrTrackingDetailsResponse
 */
async function listIvrTrackingDetails(request: ListIvrTrackingDetailsRequest): ListIvrTrackingDetailsResponse {
  var runtime = new $RuntimeOptions{};
  return listIvrTrackingDetailsWithOptions(request, runtime);
}

model ListLegacyAgentEventLogsRequest {
  agentId?: string(name='AgentId', example='agent@ccc-test'),
  endTime?: long(name='EndTime', description='This parameter is required.', example='1658026440011'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='100'),
  startTime?: long(name='StartTime', description='This parameter is required.', example='1657853640015'),
}

model ListLegacyAgentEventLogsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        agentDropCall?: string(name='AgentDropCall', example='false'),
        agentNo?: string(name='AgentNo', example='agent@ccc-test'),
        callDir?: string(name='CallDir'),
        callId?: string(name='CallId', example='378654****'),
        callMode?: string(name='CallMode'),
        callType?: string(name='CallType'),
        calleeId?: string(name='CalleeId', example='1312343****'),
        callerId?: string(name='CallerId', example='08331111****'),
        connId?: string(name='ConnId', example='345467****'),
        event?: string(name='Event'),
        groupNo?: string(name='GroupNo', example='skillgroup1@ccc-test,skillgroup2@ccc-test'),
        outboundScenario?: boolean(name='OutboundScenario', example='false'),
        phoneNo?: string(name='PhoneNo', example='8012****'),
        statisticDate?: string(name='StatisticDate', example='2021-12-03T10:15:30'),
        targetRequest?: string(name='TargetRequest', example='skillgroup@ccc-test'),
        targetSelect?: string(name='TargetSelect', example='skillgroup@ccc-test'),
        tenantId?: string(name='TenantId', example='acc101'),
        transferNumber?: string(name='TransferNumber', example='07518888****'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='100'),
    totalCount?: int32(name='TotalCount', example='10'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='2802EE59-3B53-513A-A130-85E480AF689D'),
  success?: boolean(name='Success', example='true'),
}

model ListLegacyAgentEventLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListLegacyAgentEventLogsResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI ListLegacyAgentEventLogs is deprecated, please use CCC::2020-07-01::ListAgentStateLogs instead.
 *
 * @summary ListLegacyAgentEventLogs
 *
 * @param request ListLegacyAgentEventLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListLegacyAgentEventLogsResponse
 */
// Deprecated
async function listLegacyAgentEventLogsWithOptions(request: ListLegacyAgentEventLogsRequest, runtime: $RuntimeOptions): ListLegacyAgentEventLogsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentId)) {
    query['AgentId'] = request.agentId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListLegacyAgentEventLogs',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @deprecated OpenAPI ListLegacyAgentEventLogs is deprecated, please use CCC::2020-07-01::ListAgentStateLogs instead.
 *
 * @summary ListLegacyAgentEventLogs
 *
 * @param request ListLegacyAgentEventLogsRequest
 * @return ListLegacyAgentEventLogsResponse
 */
// Deprecated
async function listLegacyAgentEventLogs(request: ListLegacyAgentEventLogsRequest): ListLegacyAgentEventLogsResponse {
  var runtime = new $RuntimeOptions{};
  return listLegacyAgentEventLogsWithOptions(request, runtime);
}

model ListLegacyAgentStatusLogsRequest {
  agentId?: string(name='AgentId', example='agent@ccc-test'),
  endTime?: long(name='EndTime', description='This parameter is required.', example='1657879880010'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='100'),
  startTime?: long(name='StartTime', description='This parameter is required.', example='1657778840011'),
}

model ListLegacyAgentStatusLogsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        agentDropCall?: string(name='AgentDropCall', example='false'),
        agentNo?: string(name='AgentNo', example='agent@ccc-test'),
        aliHangupCause?: string(name='AliHangupCause'),
        callDir?: string(name='CallDir'),
        callId?: string(name='CallId', example='454326****'),
        callType?: string(name='CallType'),
        calleeId?: string(name='CalleeId', example='1312121****'),
        callerId?: string(name='CallerId', example='08337676****'),
        connId?: string(name='ConnId', example='487326****'),
        extend1?: string(name='Extend1'),
        extend2?: string(name='Extend2'),
        extend3?: string(name='Extend3'),
        extend4?: string(name='Extend4'),
        groupNo?: string(name='GroupNo', example='skillgroup@ccc-test'),
        monitedAgentNo?: string(name='MonitedAgentNo', example='8032****'),
        monitedAgentPhoneNo?: string(name='MonitedAgentPhoneNo', example='8012****'),
        outboundScenario?: boolean(name='OutboundScenario', example='false'),
        phoneNo?: string(name='PhoneNo', example='8012****'),
        statisticDate?: string(name='StatisticDate', example='2021-12-03T10:15:30'),
        statisticTime?: int32(name='StatisticTime', example='3'),
        status?: string(name='Status'),
        targetRequest?: string(name='TargetRequest', example='skillgroup@ccc-test'),
        targetSelect?: string(name='TargetSelect', example='skillgroup@ccc-test'),
        tenantId?: string(name='TenantId', example='acc6736'),
        transferNo?: string(name='TransferNo', example='07551231****'),
        transferNumber?: string(name='TransferNumber', example='05711231****'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='100'),
    totalCount?: int32(name='TotalCount', example='10'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='4C9A5D93-33A6-57F3-A423-4C83BD0A8455'),
  success?: boolean(name='Success', example='true'),
}

model ListLegacyAgentStatusLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListLegacyAgentStatusLogsResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI ListLegacyAgentStatusLogs is deprecated, please use CCC::2020-07-01::ListAgentStateLogs instead.
 *
 * @summary ListLegacyAgentStatusLogs
 *
 * @param request ListLegacyAgentStatusLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListLegacyAgentStatusLogsResponse
 */
// Deprecated
async function listLegacyAgentStatusLogsWithOptions(request: ListLegacyAgentStatusLogsRequest, runtime: $RuntimeOptions): ListLegacyAgentStatusLogsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentId)) {
    query['AgentId'] = request.agentId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListLegacyAgentStatusLogs',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @deprecated OpenAPI ListLegacyAgentStatusLogs is deprecated, please use CCC::2020-07-01::ListAgentStateLogs instead.
 *
 * @summary ListLegacyAgentStatusLogs
 *
 * @param request ListLegacyAgentStatusLogsRequest
 * @return ListLegacyAgentStatusLogsResponse
 */
// Deprecated
async function listLegacyAgentStatusLogs(request: ListLegacyAgentStatusLogsRequest): ListLegacyAgentStatusLogsResponse {
  var runtime = new $RuntimeOptions{};
  return listLegacyAgentStatusLogsWithOptions(request, runtime);
}

model ListLegacyAppraiseLogsRequest {
  endTime?: long(name='EndTime', description='This parameter is required.', example='1620273600000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  startTime?: long(name='StartTime', description='This parameter is required.', example='1604638129000'),
}

model ListLegacyAppraiseLogsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        acid?: string(name='Acid', example='3786929579'),
        contactType?: string(name='ContactType', example='Outbound'),
        id?: long(name='Id', example='10505'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        keyMarkRelation?: string(name='KeyMarkRelation', example='{}'),
        note?: string(name='Note'),
        parentNote?: string(name='ParentNote'),
        pressKey?: string(name='PressKey', example='2'),
        ramId?: string(name='RamId', example='28036411123456****'),
        skillGroupId?: string(name='SkillGroupId', example='test@ccc-test'),
        statisticDate?: string(name='StatisticDate', example='2021-12-03T10:15:30'),
        type?: string(name='Type', example='Launch'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='18'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='A13BB835-94AA-4E55-8D9E-5EA585CE6555"'),
  success?: boolean(name='Success', example='true'),
}

model ListLegacyAppraiseLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListLegacyAppraiseLogsResponseBody(name='body'),
}

/**
 * @summary ListLegacyAppraiseLogs
 *
 * @param request ListLegacyAppraiseLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListLegacyAppraiseLogsResponse
 */
async function listLegacyAppraiseLogsWithOptions(request: ListLegacyAppraiseLogsRequest, runtime: $RuntimeOptions): ListLegacyAppraiseLogsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListLegacyAppraiseLogs',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary ListLegacyAppraiseLogs
 *
 * @param request ListLegacyAppraiseLogsRequest
 * @return ListLegacyAppraiseLogsResponse
 */
async function listLegacyAppraiseLogs(request: ListLegacyAppraiseLogsRequest): ListLegacyAppraiseLogsResponse {
  var runtime = new $RuntimeOptions{};
  return listLegacyAppraiseLogsWithOptions(request, runtime);
}

model ListLegacyQueueEventLogsRequest {
  endTime?: long(name='EndTime', description='This parameter is required.', example='1658026180018'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='100'),
  skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
  startTime?: long(name='StartTime', description='This parameter is required.', example='1657939540015'),
}

model ListLegacyQueueEventLogsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        acid?: string(name='Acid', example='456328****'),
        ani?: string(name='Ani', example='8012****'),
        answerPhone?: string(name='AnswerPhone', example='agent@ccc-test'),
        answerTime?: long(name='AnswerTime', example='15'),
        cause?: string(name='Cause'),
        dnis?: string(name='Dnis', example='1312211****'),
        id?: long(name='Id'),
        queueTime?: long(name='QueueTime', example='10'),
        statisticDate?: string(name='StatisticDate', example='2021-12-03T10:15:30'),
        tenantId?: string(name='TenantId', example='acc3733'),
        vq?: string(name='Vq', example='skillgroup@ccc-test'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='100'),
    totalCount?: int32(name='TotalCount', example='10'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='1A5A8998-41F9-5F85-BFCF-EB2B6E376812'),
  success?: boolean(name='Success', example='true'),
}

model ListLegacyQueueEventLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListLegacyQueueEventLogsResponseBody(name='body'),
}

/**
 * @summary ListLegacyQueueEventLogs
 *
 * @param request ListLegacyQueueEventLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListLegacyQueueEventLogsResponse
 */
async function listLegacyQueueEventLogsWithOptions(request: ListLegacyQueueEventLogsRequest, runtime: $RuntimeOptions): ListLegacyQueueEventLogsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListLegacyQueueEventLogs',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary ListLegacyQueueEventLogs
 *
 * @param request ListLegacyQueueEventLogsRequest
 * @return ListLegacyQueueEventLogsResponse
 */
async function listLegacyQueueEventLogs(request: ListLegacyQueueEventLogsRequest): ListLegacyQueueEventLogsResponse {
  var runtime = new $RuntimeOptions{};
  return listLegacyQueueEventLogsWithOptions(request, runtime);
}

model ListMonoRecordingsRequest {
  contactId?: string(name='ContactId', description='This parameter is required.', example='job-25697383427137****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model ListMonoRecordingsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      agentId?: string(name='AgentId', example='agent@ccc-test'),
      agentName?: string(name='AgentName'),
      contactId?: string(name='ContactId', example='job-25920271311543****'),
      duration?: string(name='Duration', example='5903871'),
      fileName?: string(name='FileName', example='job-25920271311543****-798f1e90-1f82-42da-914c-46580c8f4c85-1656926518491.wav'),
      fileUrl?: string(name='FileUrl', example='https://ccc-v2-shanghai.oss-cn-shanghai.aliyuncs.com/ccc-test/job-25920271311543****-798f1e90-1f82-42da-914c-46580c8f4c85-1656926518491.wav?Expires=1657014031&OSSAccessKeyId=****&Signature=****'),
      ramId?: string(name='RamId', example='26972543893791****'),
      skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
      startTime?: string(name='StartTime', example='1620259200000'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='E836EF2A-EDAE-5310-8921-F983C967D42D'),
}

model ListMonoRecordingsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMonoRecordingsResponseBody(name='body'),
}

/**
 * @param request ListMonoRecordingsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMonoRecordingsResponse
 */
async function listMonoRecordingsWithOptions(request: ListMonoRecordingsRequest, runtime: $RuntimeOptions): ListMonoRecordingsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactId)) {
    query['ContactId'] = request.contactId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListMonoRecordings',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListMonoRecordingsRequest
 * @return ListMonoRecordingsResponse
 */
async function listMonoRecordings(request: ListMonoRecordingsRequest): ListMonoRecordingsResponse {
  var runtime = new $RuntimeOptions{};
  return listMonoRecordingsWithOptions(request, runtime);
}

model ListMultiChannelRecordingsRequest {
  contactId?: string(name='ContactId', description='This parameter is required.', example='job-25920271311543****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model ListMultiChannelRecordingsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      agentChannelId?: string(name='AgentChannelId', example='ch-user-8526899****-8602****-1656926504363-job-25920271311543****'),
      agentId?: string(name='AgentId', example='agent@ccc-test'),
      agentName?: string(name='AgentName'),
      contactId?: string(name='ContactId', example='job-25920271311543****'),
      duration?: string(name='Duration', example='56321'),
      fileName?: string(name='FileName', example='job-25920271311543****-798f1e90-1f82-42da-914c-46580c8f4c85-1656926518491.mkv'),
      fileUrl?: string(name='FileUrl', example='https://ccc-v2-shanghai.oss-cn-shanghai.aliyuncs.com/ccc-test/job-25920271311543****-798f1e90-1f82-42da-914c-46580c8f4c85-1656926518491.mkv?Expires=1657014031&OSSAccessKeyId=****&Signature=****'),
      holdTimeSegments?: [ 
        {
          endTime?: long(name='EndTime'),
          startTime?: long(name='StartTime'),
        }
      ](name='HoldTimeSegments'),
      ramId?: string(name='RamId', example='22807673106369****'),
      skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
      startTime?: long(name='StartTime', example='1656926518491'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='B19CD719-9F65-56A6-8B79-DA4282EA4797'),
}

model ListMultiChannelRecordingsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMultiChannelRecordingsResponseBody(name='body'),
}

/**
 * @param request ListMultiChannelRecordingsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMultiChannelRecordingsResponse
 */
async function listMultiChannelRecordingsWithOptions(request: ListMultiChannelRecordingsRequest, runtime: $RuntimeOptions): ListMultiChannelRecordingsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactId)) {
    query['ContactId'] = request.contactId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListMultiChannelRecordings',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListMultiChannelRecordingsRequest
 * @return ListMultiChannelRecordingsResponse
 */
async function listMultiChannelRecordings(request: ListMultiChannelRecordingsRequest): ListMultiChannelRecordingsResponse {
  var runtime = new $RuntimeOptions{};
  return listMultiChannelRecordingsWithOptions(request, runtime);
}

model ListOutboundNumbersOfUserRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  skillGroupIdList?: string(name='SkillGroupIdList', example='["skillgroup1@ccc-test","skillgroup2@ccc-test"]'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model ListOutboundNumbersOfUserResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        city?: string(name='City'),
        number?: string(name='Number', example='0830019****'),
        province?: string(name='Province'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ListOutboundNumbersOfUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListOutboundNumbersOfUserResponseBody(name='body'),
}

/**
 * @param request ListOutboundNumbersOfUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListOutboundNumbersOfUserResponse
 */
async function listOutboundNumbersOfUserWithOptions(request: ListOutboundNumbersOfUserRequest, runtime: $RuntimeOptions): ListOutboundNumbersOfUserResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.skillGroupIdList)) {
    query['SkillGroupIdList'] = request.skillGroupIdList;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListOutboundNumbersOfUser',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListOutboundNumbersOfUserRequest
 * @return ListOutboundNumbersOfUserResponse
 */
async function listOutboundNumbersOfUser(request: ListOutboundNumbersOfUserRequest): ListOutboundNumbersOfUserResponse {
  var runtime = new $RuntimeOptions{};
  return listOutboundNumbersOfUserWithOptions(request, runtime);
}

model ListPersonalNumbersOfUserRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  isMember?: boolean(name='IsMember', description='This parameter is required.', example='true'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  searchPattern?: string(name='SearchPattern', example='0833'),
  userId?: string(name='UserId', description='This parameter is required.', example='user-test@ccc-test'),
}

model ListPersonalNumbersOfUserResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        active?: boolean(name='Active', example='true'),
        city?: string(name='City'),
        contactFlowId?: string(name='ContactFlowId', example='a3fb6c62-9b49-4942-ae5b-cf2abd4123ek'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        number?: string(name='Number', example='08330011****'),
        province?: string(name='Province'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ListPersonalNumbersOfUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPersonalNumbersOfUserResponseBody(name='body'),
}

/**
 * @param request ListPersonalNumbersOfUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPersonalNumbersOfUserResponse
 */
async function listPersonalNumbersOfUserWithOptions(request: ListPersonalNumbersOfUserRequest, runtime: $RuntimeOptions): ListPersonalNumbersOfUserResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.isMember)) {
    query['IsMember'] = request.isMember;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.searchPattern)) {
    query['SearchPattern'] = request.searchPattern;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListPersonalNumbersOfUser',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListPersonalNumbersOfUserRequest
 * @return ListPersonalNumbersOfUserResponse
 */
async function listPersonalNumbersOfUser(request: ListPersonalNumbersOfUserRequest): ListPersonalNumbersOfUserResponse {
  var runtime = new $RuntimeOptions{};
  return listPersonalNumbersOfUserWithOptions(request, runtime);
}

model ListPhoneNumbersRequest {
  active?: boolean(name='Active', example='true'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='20'),
  searchPattern?: string(name='SearchPattern', example='0833'),
  usage?: string(name='Usage', example='Bidirection'),
}

model ListPhoneNumbersResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        active?: boolean(name='Active', example='true'),
        city?: string(name='City'),
        contactFlowId?: string(name='ContactFlowId', example='a3fb6c62-9b49-4942-ae5b-cf2abd4123ek'),
        contactFlowName?: string(name='ContactFlowName'),
        createTime?: string(name='CreateTime', example='1617958538000'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        number?: string(name='Number', example='08330011****'),
        provider?: string(name='Provider', example='alicom'),
        province?: string(name='Province'),
        skillGroups?: [ 
          {
            displayName?: string(name='DisplayName'),
            instanceId?: string(name='InstanceId', example='ccc-test'),
            name?: string(name='Name', example='skillgroup'),
            skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
          }
        ](name='SkillGroups'),
        tags?: string(name='Tags', example='M1'),
        usage?: string(name='Usage', example='Bidirection'),
        userId?: string(name='UserId', example='agent@ccc-test'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='20'),
    totalCount?: int32(name='TotalCount', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model ListPhoneNumbersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPhoneNumbersResponseBody(name='body'),
}

/**
 * @summary 获取号码列表
 *
 * @param request ListPhoneNumbersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPhoneNumbersResponse
 */
async function listPhoneNumbersWithOptions(request: ListPhoneNumbersRequest, runtime: $RuntimeOptions): ListPhoneNumbersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.active)) {
    query['Active'] = request.active;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.searchPattern)) {
    query['SearchPattern'] = request.searchPattern;
  }
  if (!$isNull(request.usage)) {
    query['Usage'] = request.usage;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListPhoneNumbers',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取号码列表
 *
 * @param request ListPhoneNumbersRequest
 * @return ListPhoneNumbersResponse
 */
async function listPhoneNumbers(request: ListPhoneNumbersRequest): ListPhoneNumbersResponse {
  var runtime = new $RuntimeOptions{};
  return listPhoneNumbersWithOptions(request, runtime);
}

model ListPhoneNumbersOfSkillGroupRequest {
  active?: boolean(name='Active', example='true'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  isMember?: boolean(name='IsMember', description='This parameter is required.', example='true'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  searchPattern?: string(name='SearchPattern', example='0833'),
  skillGroupId?: string(name='SkillGroupId', description='This parameter is required.', example='skillgroup@ccc-test'),
}

model ListPhoneNumbersOfSkillGroupResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        active?: boolean(name='Active', example='true'),
        city?: string(name='City'),
        contactFlowId?: string(name='ContactFlowId', example='a3fb6c62-9b49-4942-ae5b-cf2abd4123ek'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        number?: string(name='Number', example='08330011****'),
        province?: string(name='Province'),
        usage?: string(name='Usage', example='Bidirection'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ListPhoneNumbersOfSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPhoneNumbersOfSkillGroupResponseBody(name='body'),
}

/**
 * @param request ListPhoneNumbersOfSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPhoneNumbersOfSkillGroupResponse
 */
async function listPhoneNumbersOfSkillGroupWithOptions(request: ListPhoneNumbersOfSkillGroupRequest, runtime: $RuntimeOptions): ListPhoneNumbersOfSkillGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.active)) {
    query['Active'] = request.active;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.isMember)) {
    query['IsMember'] = request.isMember;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.searchPattern)) {
    query['SearchPattern'] = request.searchPattern;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListPhoneNumbersOfSkillGroup',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListPhoneNumbersOfSkillGroupRequest
 * @return ListPhoneNumbersOfSkillGroupResponse
 */
async function listPhoneNumbersOfSkillGroup(request: ListPhoneNumbersOfSkillGroupRequest): ListPhoneNumbersOfSkillGroupResponse {
  var runtime = new $RuntimeOptions{};
  return listPhoneNumbersOfSkillGroupWithOptions(request, runtime);
}

model ListPrivilegesOfUserRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model ListPrivilegesOfUserResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      instanceId?: string(name='InstanceId', example='ccc-test'),
      name?: string(name='Name', example='Workbench:Call'),
      scope?: string(name='Scope', example='SELF_ONLY'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ListPrivilegesOfUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPrivilegesOfUserResponseBody(name='body'),
}

/**
 * @param request ListPrivilegesOfUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPrivilegesOfUserResponse
 */
async function listPrivilegesOfUserWithOptions(request: ListPrivilegesOfUserRequest, runtime: $RuntimeOptions): ListPrivilegesOfUserResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListPrivilegesOfUser',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListPrivilegesOfUserRequest
 * @return ListPrivilegesOfUserResponse
 */
async function listPrivilegesOfUser(request: ListPrivilegesOfUserRequest): ListPrivilegesOfUserResponse {
  var runtime = new $RuntimeOptions{};
  return listPrivilegesOfUserWithOptions(request, runtime);
}

model ListRamUsersRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  searchPattern?: string(name='SearchPattern', example='agent'),
}

model ListRamUsersResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        aliyunUid?: long(name='AliyunUid', example='15772400000****'),
        displayName?: string(name='DisplayName'),
        email?: string(name='Email', example='username@example.com'),
        loginName?: string(name='LoginName', example='agent'),
        mobile?: string(name='Mobile', example='1382114****'),
        primary?: boolean(name='Primary', example='false'),
        ramId?: string(name='RamId', example='28036411123456****'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='100'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='24753D71-C91D-1A38-A8AD-372BF12453F6'),
}

model ListRamUsersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRamUsersResponseBody(name='body'),
}

/**
 * @param request ListRamUsersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRamUsersResponse
 */
async function listRamUsersWithOptions(request: ListRamUsersRequest, runtime: $RuntimeOptions): ListRamUsersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.searchPattern)) {
    query['SearchPattern'] = request.searchPattern;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListRamUsers',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListRamUsersRequest
 * @return ListRamUsersResponse
 */
async function listRamUsers(request: ListRamUsersRequest): ListRamUsersResponse {
  var runtime = new $RuntimeOptions{};
  return listRamUsersWithOptions(request, runtime);
}

model ListRealtimeAgentStatesRequest {
  agentIdList?: string(name='AgentIdList', example='["agent1@ccc-test", "agent2@ccc-test"]'),
  agentName?: string(name='AgentName', example='agent'),
  callTypeList?: string(name='CallTypeList', example='["INBOUND", "OUTBOUND"]'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  mediaType?: string(name='MediaType'),
  outboundScenario?: boolean(name='OutboundScenario', example='false'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  query?: string(name='Query', example='agent'),
  skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
  stateList?: string(name='StateList', example='["ACW", "Dialing"]'),
  workModeList?: string(name='WorkModeList', example='["OFFICE_PHONE","ON_SITE"]'),
}

model ListRealtimeAgentStatesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        agentId?: string(name='AgentId', example='agent1@ccc-test'),
        agentName?: string(name='AgentName'),
        breakCode?: string(name='BreakCode'),
        callType?: string(name='CallType', example='Outbound'),
        counterParty?: string(name='CounterParty', example='agent@ccc-test'),
        duration?: long(name='Duration', example='16'),
        extension?: string(name='Extension', example='80317391'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        mobile?: string(name='Mobile', example='1382114****'),
        outboundScenario?: boolean(name='OutboundScenario', example='false'),
        skillGroupIdList?: [ string ](name='SkillGroupIdList'),
        skillGroupNameList?: [ string ](name='SkillGroupNameList'),
        state?: string(name='State', example='ACW'),
        stateCode?: string(name='StateCode', example='Monitored'),
        stateTime?: long(name='StateTime', example='8'),
        workMode?: string(name='WorkMode', example='ON_SITE'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ListRealtimeAgentStatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRealtimeAgentStatesResponseBody(name='body'),
}

/**
 * @param request ListRealtimeAgentStatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRealtimeAgentStatesResponse
 */
async function listRealtimeAgentStatesWithOptions(request: ListRealtimeAgentStatesRequest, runtime: $RuntimeOptions): ListRealtimeAgentStatesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentName)) {
    query['AgentName'] = request.agentName;
  }
  if (!$isNull(request.callTypeList)) {
    query['CallTypeList'] = request.callTypeList;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!$isNull(request.outboundScenario)) {
    query['OutboundScenario'] = request.outboundScenario;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.query)) {
    query['Query'] = request.query;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  if (!$isNull(request.workModeList)) {
    query['WorkModeList'] = request.workModeList;
  }
  var body : map[string]any = {};
  if (!$isNull(request.agentIdList)) {
    body['AgentIdList'] = request.agentIdList;
  }
  if (!$isNull(request.stateList)) {
    body['StateList'] = request.stateList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListRealtimeAgentStates',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListRealtimeAgentStatesRequest
 * @return ListRealtimeAgentStatesResponse
 */
async function listRealtimeAgentStates(request: ListRealtimeAgentStatesRequest): ListRealtimeAgentStatesResponse {
  var runtime = new $RuntimeOptions{};
  return listRealtimeAgentStatesWithOptions(request, runtime);
}

model ListRealtimeSkillGroupStatesRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  mediaType?: string(name='MediaType'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  skillGroupIdList?: string(name='SkillGroupIdList', example='["skillgroup1@ccc-test", "skillgroup2@ccc-test"]'),
}

model ListRealtimeSkillGroupStatesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        breakCodeDetailList?: [ 
          {
            breakCode?: string(name='BreakCode'),
            count?: long(name='Count'),
          }
        ](name='BreakCodeDetailList'),
        breakingAgents?: long(name='BreakingAgents', example='0'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        loggedInAgents?: long(name='LoggedInAgents', example='2'),
        longestWaitingTime?: long(name='LongestWaitingTime', example='0'),
        outboundScenarioReadyAgents?: long(name='OutboundScenarioReadyAgents', example='0'),
        readyAgents?: long(name='ReadyAgents', example='2'),
        skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
        skillGroupName?: string(name='SkillGroupName', example='skillgroup'),
        talkingAgents?: long(name='TalkingAgents', example='0'),
        totalAgents?: long(name='TotalAgents'),
        waitingCalls?: long(name='WaitingCalls', example='0'),
        workingAgents?: long(name='WorkingAgents', example='0'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='2'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='26A34338-5CD9-4C95-A7A6-5BDCE76C6B94'),
}

model ListRealtimeSkillGroupStatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRealtimeSkillGroupStatesResponseBody(name='body'),
}

/**
 * @param request ListRealtimeSkillGroupStatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRealtimeSkillGroupStatesResponse
 */
async function listRealtimeSkillGroupStatesWithOptions(request: ListRealtimeSkillGroupStatesRequest, runtime: $RuntimeOptions): ListRealtimeSkillGroupStatesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var body : map[string]any = {};
  if (!$isNull(request.skillGroupIdList)) {
    body['SkillGroupIdList'] = request.skillGroupIdList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListRealtimeSkillGroupStates',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListRealtimeSkillGroupStatesRequest
 * @return ListRealtimeSkillGroupStatesResponse
 */
async function listRealtimeSkillGroupStates(request: ListRealtimeSkillGroupStatesRequest): ListRealtimeSkillGroupStatesResponse {
  var runtime = new $RuntimeOptions{};
  return listRealtimeSkillGroupStatesWithOptions(request, runtime);
}

model ListRecentCallDetailRecordsRequest {
  criteria?: string(name='Criteria', example='{"phoneNumber":"1312121****","callingNumber":"1312121****","calledNumber":"1312121****"}'),
  endTime?: long(name='EndTime', example='1604639129000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  startTime?: long(name='StartTime', example='1604638129000'),
}

model ListRecentCallDetailRecordsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        agentIds?: string(name='AgentIds', example='agent@ccc-test'),
        callDuration?: string(name='CallDuration', example='16'),
        calledNumber?: string(name='CalledNumber', example='1332315****'),
        callingNumber?: string(name='CallingNumber', example='0533128****'),
        contactDisposition?: string(name='ContactDisposition', example='Success'),
        contactId?: string(name='ContactId', example='job-7660472242845****'),
        contactType?: string(name='ContactType', example='Outbound'),
        duration?: long(name='Duration', example='16'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        skillGroupIds?: string(name='SkillGroupIds', example='skillgroup@ccc-test'),
        startTime?: long(name='StartTime', example='1532448000000'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='11'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ListRecentCallDetailRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRecentCallDetailRecordsResponseBody(name='body'),
}

/**
 * @param request ListRecentCallDetailRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRecentCallDetailRecordsResponse
 */
async function listRecentCallDetailRecordsWithOptions(request: ListRecentCallDetailRecordsRequest, runtime: $RuntimeOptions): ListRecentCallDetailRecordsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.criteria)) {
    query['Criteria'] = request.criteria;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var body : map[string]any = {};
  if (!$isNull(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListRecentCallDetailRecords',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListRecentCallDetailRecordsRequest
 * @return ListRecentCallDetailRecordsResponse
 */
async function listRecentCallDetailRecords(request: ListRecentCallDetailRecordsRequest): ListRecentCallDetailRecordsResponse {
  var runtime = new $RuntimeOptions{};
  return listRecentCallDetailRecordsWithOptions(request, runtime);
}

model ListRolesRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model ListRolesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      name?: string(name='Name', example='Admin'),
      roleId?: string(name='RoleId', example='Admin@ccc-test'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='711D948F-C616-4E23-8573-0F260513CE09'),
}

model ListRolesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRolesResponseBody(name='body'),
}

/**
 * @param request ListRolesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRolesResponse
 */
async function listRolesWithOptions(request: ListRolesRequest, runtime: $RuntimeOptions): ListRolesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListRoles',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListRolesRequest
 * @return ListRolesResponse
 */
async function listRoles(request: ListRolesRequest): ListRolesResponse {
  var runtime = new $RuntimeOptions{};
  return listRolesWithOptions(request, runtime);
}

model ListSkillGroupStatesRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='100'),
  skillGroupIds?: string(name='SkillGroupIds', example='["skillgroup1@ccc-test","skillgroup2@ccc-test"]'),
}

model ListSkillGroupStatesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        averageWaitingTime?: long(name='AverageWaitingTime', example='3'),
        breakingAgents?: long(name='BreakingAgents', example='0'),
        inboundTalkingAgents?: long(name='InboundTalkingAgents'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        loggedInAgents?: long(name='LoggedInAgents', example='0'),
        longestCall?: long(name='LongestCall', example='0'),
        outboundScenarioReadyAgents?: long(name='OutboundScenarioReadyAgents', example='0'),
        outboundTalkingAgents?: long(name='OutboundTalkingAgents'),
        readyAgents?: long(name='ReadyAgents', example='1'),
        skillGroupId?: string(name='SkillGroupId', example='skillgroup1@ccc-test'),
        skillGroupName?: string(name='SkillGroupName'),
        talkingAgents?: long(name='TalkingAgents', example='0'),
        waitingCalls?: long(name='WaitingCalls', example='0'),
        waitingCallsLevel10?: long(name='WaitingCallsLevel10', example='0'),
        waitingCallsLevel20?: long(name='WaitingCallsLevel20', example='0'),
        waitingCallsLevel30?: long(name='WaitingCallsLevel30', example='0'),
        workingAgents?: long(name='WorkingAgents', example='0'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='100'),
    totalCount?: int32(name='TotalCount', example='10'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='1F69EBB0-63E9-5DDE-887F-9FC040ADF309'),
  success?: boolean(name='Success', example='true'),
}

model ListSkillGroupStatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSkillGroupStatesResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI ListSkillGroupStates is deprecated, please use CCC::2020-07-01::ListRealtimeSkillGroupStates instead.
 *
 * @summary ListSkillGroupStates for acc
 *
 * @param request ListSkillGroupStatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSkillGroupStatesResponse
 */
// Deprecated
async function listSkillGroupStatesWithOptions(request: ListSkillGroupStatesRequest, runtime: $RuntimeOptions): ListSkillGroupStatesResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListSkillGroupStates',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @deprecated OpenAPI ListSkillGroupStates is deprecated, please use CCC::2020-07-01::ListRealtimeSkillGroupStates instead.
 *
 * @summary ListSkillGroupStates for acc
 *
 * @param request ListSkillGroupStatesRequest
 * @return ListSkillGroupStatesResponse
 */
// Deprecated
async function listSkillGroupStates(request: ListSkillGroupStatesRequest): ListSkillGroupStatesResponse {
  var runtime = new $RuntimeOptions{};
  return listSkillGroupStatesWithOptions(request, runtime);
}

model ListSkillGroupSummaryReportsSinceMidnightRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  skillGroups?: string(name='SkillGroups', example='["skillgroup1@ccc-test", "skillgroup2@ccc-test2"]'),
}

model ListSkillGroupSummaryReportsSinceMidnightResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  pagedSkillGroupSummaryReport?: {
    list?: [ 
      {
        inbound?: {
          abandonedInQueueOfQueueCount?: long(name='AbandonedInQueueOfQueueCount', example='0'),
          answeredByAgentOfQueueCount?: long(name='AnsweredByAgentOfQueueCount', example='0'),
          answeredByAgentOfQueueMaxWaitTimeDuration?: long(name='AnsweredByAgentOfQueueMaxWaitTimeDuration', example='0'),
          answeredByAgentOfQueueWaitTimeDuration?: long(name='AnsweredByAgentOfQueueWaitTimeDuration', example='0'),
          averageRingTime?: long(name='AverageRingTime', example='0'),
          averageTalkTime?: long(name='AverageTalkTime', example='0'),
          averageWorkTime?: long(name='AverageWorkTime', example='0'),
          callsAbandoned?: long(name='CallsAbandoned'),
          callsAttendedTransferOut?: long(name='CallsAttendedTransferOut', example='0'),
          callsBlindTransferOut?: long(name='CallsBlindTransferOut', example='0'),
          callsHandled?: long(name='CallsHandled', example='0'),
          callsOffered?: long(name='CallsOffered', example='0'),
          callsOverflow?: string(name='CallsOverflow'),
          callsQueuingCanceled?: string(name='CallsQueuingCanceled'),
          callsQueuingFailure?: string(name='CallsQueuingFailure'),
          callsQueuingRerouted?: string(name='CallsQueuingRerouted'),
          callsQueuingTimeout?: long(name='CallsQueuingTimeout'),
          callsServiceLevel10?: long(name='CallsServiceLevel10', example='0'),
          callsServiceLevel20?: long(name='CallsServiceLevel20', example='0'),
          callsServiceLevel30?: long(name='CallsServiceLevel30', example='0'),
          callsTimeout?: long(name='CallsTimeout'),
          giveUpByAgentOfQueueCount?: long(name='GiveUpByAgentOfQueueCount', example='0'),
          handleRate?: float(name='HandleRate', example='0'),
          inComingQueueOfQueueCount?: long(name='InComingQueueOfQueueCount', example='0'),
          maxRingTime?: long(name='MaxRingTime', example='0'),
          maxTalkTime?: string(name='MaxTalkTime', example='0'),
          maxWorkTime?: long(name='MaxWorkTime', example='0'),
          overFlowInQueueOfQueueCount?: long(name='OverFlowInQueueOfQueueCount', example='0'),
          queueMaxWaitTimeDuration?: long(name='QueueMaxWaitTimeDuration', example='0'),
          queueWaitTimeDuration?: long(name='QueueWaitTimeDuration', example='0'),
          satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
          satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
          satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
          serviceLevel20?: float(name='ServiceLevel20', example='0'),
          totalRingTime?: long(name='TotalRingTime', example='0'),
          totalTalkTime?: long(name='TotalTalkTime', example='0'),
          totalWorkTime?: long(name='TotalWorkTime', example='0'),
        }(name='Inbound'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        outbound?: {
          answerRate?: float(name='AnswerRate', example='0'),
          averageDialingTime?: long(name='AverageDialingTime', example='0'),
          averageTalkTime?: long(name='AverageTalkTime', example='0'),
          averageWorkTime?: long(name='AverageWorkTime', example='0'),
          callsAbandoned?: long(name='CallsAbandoned'),
          callsAgentHandled?: long(name='CallsAgentHandled'),
          callsAnswered?: long(name='CallsAnswered', example='0'),
          callsDialed?: long(name='CallsDialed', example='0'),
          callsOffered?: long(name='CallsOffered'),
          callsQueuingCancelled?: long(name='CallsQueuingCancelled'),
          callsQueuingFailed?: long(name='CallsQueuingFailed'),
          callsQueuingFailure?: long(name='CallsQueuingFailure'),
          callsQueuingOverflow?: long(name='CallsQueuingOverflow'),
          callsQueuingRerouted?: long(name='CallsQueuingRerouted'),
          callsQueuingTimeout?: long(name='CallsQueuingTimeout'),
          callsServiceLevel30?: string(name='CallsServiceLevel30', example='0'),
          callsServiceLevel30V2?: long(name='CallsServiceLevel30V2'),
          maxDialingTime?: long(name='MaxDialingTime', example='0'),
          maxTalkTime?: long(name='MaxTalkTime', example='0'),
          maxWorkTime?: long(name='MaxWorkTime', example='0'),
          satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
          satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
          satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
          totalDialingTime?: long(name='TotalDialingTime', example='0'),
          totalTalkTime?: long(name='TotalTalkTime', example='0'),
          totalWaitTime?: long(name='TotalWaitTime'),
          totalWorkTime?: long(name='TotalWorkTime', example='0'),
        }(name='Outbound'),
        overall?: {
          averageReadyTime?: long(name='AverageReadyTime', example='0'),
          averageTalkTime?: long(name='AverageTalkTime', example='0'),
          averageWorkTime?: long(name='AverageWorkTime', example='0'),
          maxReadyTime?: long(name='MaxReadyTime', example='0'),
          maxTalkTime?: long(name='MaxTalkTime', example='0'),
          maxWorkTime?: long(name='MaxWorkTime', example='0'),
          occupancyRate?: float(name='OccupancyRate', example='0'),
          satisfactionIndex?: float(name='SatisfactionIndex', example='0'),
          satisfactionSurveysOffered?: long(name='SatisfactionSurveysOffered', example='0'),
          satisfactionSurveysResponded?: long(name='SatisfactionSurveysResponded', example='0'),
          totalBreakTime?: long(name='TotalBreakTime', example='0'),
          totalCalls?: long(name='TotalCalls', example='0'),
          totalLoggedInTime?: long(name='TotalLoggedInTime', example='0'),
          totalReadyTime?: long(name='TotalReadyTime', example='0'),
          totalTalkTime?: long(name='TotalTalkTime', example='0'),
          totalWorkTime?: long(name='TotalWorkTime', example='0'),
        }(name='Overall'),
        skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
        skillGroupName?: string(name='SkillGroupName'),
        timestamp?: string(name='Timestamp', example='2018-09-13 00:00:00'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='3'),
  }(name='PagedSkillGroupSummaryReport'),
  requestId?: string(name='RequestId', example='2B36CEBC-6D11-5451-9E6B-C6D1927841C5'),
  success?: boolean(name='Success', example='true'),
}

model ListSkillGroupSummaryReportsSinceMidnightResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSkillGroupSummaryReportsSinceMidnightResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI ListSkillGroupSummaryReportsSinceMidnight is deprecated, please use CCC::2020-07-01::ListHistoricalSkillGroupReport instead.
 *
 * @summary ListSkillGroupSummaryReportsSinceMidnight for acc
 *
 * @param request ListSkillGroupSummaryReportsSinceMidnightRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSkillGroupSummaryReportsSinceMidnightResponse
 */
// Deprecated
async function listSkillGroupSummaryReportsSinceMidnightWithOptions(request: ListSkillGroupSummaryReportsSinceMidnightRequest, runtime: $RuntimeOptions): ListSkillGroupSummaryReportsSinceMidnightResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListSkillGroupSummaryReportsSinceMidnight',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @deprecated OpenAPI ListSkillGroupSummaryReportsSinceMidnight is deprecated, please use CCC::2020-07-01::ListHistoricalSkillGroupReport instead.
 *
 * @summary ListSkillGroupSummaryReportsSinceMidnight for acc
 *
 * @param request ListSkillGroupSummaryReportsSinceMidnightRequest
 * @return ListSkillGroupSummaryReportsSinceMidnightResponse
 */
// Deprecated
async function listSkillGroupSummaryReportsSinceMidnight(request: ListSkillGroupSummaryReportsSinceMidnightRequest): ListSkillGroupSummaryReportsSinceMidnightResponse {
  var runtime = new $RuntimeOptions{};
  return listSkillGroupSummaryReportsSinceMidnightWithOptions(request, runtime);
}

model ListSkillGroupsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  mediaType?: string(name='MediaType'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  searchPattern?: string(name='SearchPattern'),
}

model ListSkillGroupsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        description?: string(name='Description'),
        displayName?: string(name='DisplayName'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        mediaType?: string(name='MediaType'),
        phoneNumberCount?: int32(name='PhoneNumberCount', example='1'),
        skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
        skillGroupName?: string(name='SkillGroupName', example='skillgroup'),
        userCount?: int32(name='UserCount', example='2'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model ListSkillGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSkillGroupsResponseBody(name='body'),
}

/**
 * @param request ListSkillGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSkillGroupsResponse
 */
async function listSkillGroupsWithOptions(request: ListSkillGroupsRequest, runtime: $RuntimeOptions): ListSkillGroupsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.searchPattern)) {
    query['SearchPattern'] = request.searchPattern;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListSkillGroups',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListSkillGroupsRequest
 * @return ListSkillGroupsResponse
 */
async function listSkillGroups(request: ListSkillGroupsRequest): ListSkillGroupsResponse {
  var runtime = new $RuntimeOptions{};
  return listSkillGroupsWithOptions(request, runtime);
}

model ListSkillLevelsOfUserRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  isMember?: boolean(name='IsMember', example='true'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  searchPattern?: string(name='SearchPattern', example='skillgroup'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model ListSkillLevelsOfUserResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        mediaType?: string(name='MediaType'),
        skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
        skillGroupName?: string(name='SkillGroupName', example='skillgroup'),
        skillLevel?: string(name='SkillLevel', example='5'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='10'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ListSkillLevelsOfUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSkillLevelsOfUserResponseBody(name='body'),
}

/**
 * @param request ListSkillLevelsOfUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSkillLevelsOfUserResponse
 */
async function listSkillLevelsOfUserWithOptions(request: ListSkillLevelsOfUserRequest, runtime: $RuntimeOptions): ListSkillLevelsOfUserResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.isMember)) {
    query['IsMember'] = request.isMember;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.searchPattern)) {
    query['SearchPattern'] = request.searchPattern;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListSkillLevelsOfUser',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListSkillLevelsOfUserRequest
 * @return ListSkillLevelsOfUserResponse
 */
async function listSkillLevelsOfUser(request: ListSkillLevelsOfUserRequest): ListSkillLevelsOfUserResponse {
  var runtime = new $RuntimeOptions{};
  return listSkillLevelsOfUserWithOptions(request, runtime);
}

model ListSmsMetadataRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='100'),
  scenarioListJson?: string(name='ScenarioListJson', example='["SATISFACTION_SURVEY","CONTACT_FLOW_NODE"]'),
}

model ListSmsMetadataResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        aliyunUid?: long(name='AliyunUid', example='15772400000****'),
        description?: string(name='Description'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        name?: string(name='Name'),
        scenario?: string(name='Scenario', example='MISSED_CALL_NOTIFICATION'),
        signName?: string(name='SignName'),
        smsMetadataId?: string(name='SmsMetadataId', example='5ffc1c9a-4d3d-4019-*****-73255fb01d1c'),
        templateCode?: string(name='TemplateCode', example='SMS_468xxxx298'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='100'),
    totalCount?: int32(name='TotalCount', example='200'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='8707EB29-BAED-4302-B999-40BA61877437'),
}

model ListSmsMetadataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSmsMetadataResponseBody(name='body'),
}

/**
 * @param request ListSmsMetadataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSmsMetadataResponse
 */
async function listSmsMetadataWithOptions(request: ListSmsMetadataRequest, runtime: $RuntimeOptions): ListSmsMetadataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.scenarioListJson)) {
    query['ScenarioListJson'] = request.scenarioListJson;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListSmsMetadata',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListSmsMetadataRequest
 * @return ListSmsMetadataResponse
 */
async function listSmsMetadata(request: ListSmsMetadataRequest): ListSmsMetadataResponse {
  var runtime = new $RuntimeOptions{};
  return listSmsMetadataWithOptions(request, runtime);
}

model ListTicketTasksRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  ticketId?: string(name='TicketId', example='5491d3b4-14ee-4341-b5f1-db2c78beddeb'),
}

model ListTicketTasksResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      action?: string(name='Action', example='CounterSignTask'),
      assignee?: string(name='Assignee', example='assignee@ccc-test'),
      assigneeName?: string(name='AssigneeName', example='assignee'),
      comment?: string(name='Comment'),
      endTime?: long(name='EndTime', example='1620269200000'),
      fileKeys?: [ string ](name='FileKeys'),
      fileUrls?: [ string ](name='FileUrls'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      startTime?: long(name='StartTime', example='1620259200000'),
      taskDefinitionNodeId?: string(name='TaskDefinitionNodeId', example='APPROVAL__6zu2QjAz'),
      taskDefinitionNodeType?: string(name='TaskDefinitionNodeType', example='APPROVAL'),
      taskId?: string(name='TaskId', example='eb039a4a6a5742c6b44ccff0c1fca745'),
      taskName?: string(name='TaskName'),
      ticketId?: string(name='TicketId', example='5491d3b4-14ee-4341-b5f1-db2c78beddeb'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='DE803553-8AA9-4B9D-9E4E-A82BC69EDCEE'),
}

model ListTicketTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTicketTasksResponseBody(name='body'),
}

/**
 * @param request ListTicketTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTicketTasksResponse
 */
async function listTicketTasksWithOptions(request: ListTicketTasksRequest, runtime: $RuntimeOptions): ListTicketTasksResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ticketId)) {
    query['TicketId'] = request.ticketId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTicketTasks',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListTicketTasksRequest
 * @return ListTicketTasksResponse
 */
async function listTicketTasks(request: ListTicketTasksRequest): ListTicketTasksResponse {
  var runtime = new $RuntimeOptions{};
  return listTicketTasksWithOptions(request, runtime);
}

model ListTicketTemplatesRequest {
  categoryId?: string(name='CategoryId', example='43c2671b-********86d0-6bd187905cc8'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='100'),
  searchPattern?: string(name='SearchPattern'),
  state?: string(name='State', example='Enabled'),
}

model ListTicketTemplatesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        appliedVersion?: string(name='AppliedVersion', example='0'),
        categoryId?: string(name='CategoryId', example='43c2671b-*****-4223-86d0-6bd187905cc8'),
        editor?: string(name='Editor', example='creator@ccc-test'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        latestVersion?: string(name='LatestVersion', example='1715780670000'),
        name?: string(name='Name'),
        processDefinition?: string(name='ProcessDefinition'),
        state?: string(name='State', example='Enabled'),
        templateId?: string(name='TemplateId', example='b5c21219-3a1e-4bc0-92e7-da66e057d2f6'),
        ticketFields?: [ 
          {
            array?: boolean(name='Array', example='false'),
            attribute?: string(name='Attribute', example='{}'),
            createdTime?: long(name='CreatedTime', example='1715780670000'),
            creator?: string(name='Creator', example='creator'),
            dataType?: string(name='DataType', example='String'),
            description?: string(name='Description'),
            disabled?: boolean(name='Disabled', example='false'),
            displayName?: string(name='DisplayName'),
            displayOrder?: int32(name='DisplayOrder', example='1'),
            editorType?: string(name='EditorType', example='textbox'),
            maxLength?: int32(name='MaxLength', example='30'),
            maximum?: double(name='Maximum', example='10'),
            minLength?: int32(name='MinLength', example='1'),
            minimum?: double(name='Minimum', example='1'),
            name?: string(name='Name', example='name'),
            pattern?: string(name='Pattern', example='^'),
            patternErrorMessage?: string(name='PatternErrorMessage'),
            readOnly?: boolean(name='ReadOnly', example='false'),
            required?: boolean(name='Required', example='false'),
            system?: boolean(name='System', example='false'),
            updatedTime?: long(name='UpdatedTime', example='1715780670000'),
          }
        ](name='TicketFields'),
        updatedTime?: long(name='UpdatedTime', example='1715780670000'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='100'),
    totalCount?: int32(name='TotalCount', example='25'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='8707EB29-BAED-4302-B999-40BA61877437'),
}

model ListTicketTemplatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTicketTemplatesResponseBody(name='body'),
}

/**
 * @param request ListTicketTemplatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTicketTemplatesResponse
 */
async function listTicketTemplatesWithOptions(request: ListTicketTemplatesRequest, runtime: $RuntimeOptions): ListTicketTemplatesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.categoryId)) {
    query['CategoryId'] = request.categoryId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.searchPattern)) {
    query['SearchPattern'] = request.searchPattern;
  }
  if (!$isNull(request.state)) {
    query['State'] = request.state;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTicketTemplates',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListTicketTemplatesRequest
 * @return ListTicketTemplatesResponse
 */
async function listTicketTemplates(request: ListTicketTemplatesRequest): ListTicketTemplatesResponse {
  var runtime = new $RuntimeOptions{};
  return listTicketTemplatesWithOptions(request, runtime);
}

model ListTicketsRequest {
  assignee?: string(name='Assignee', example='assignee@cccV2-kmz'),
  assigneeType?: string(name='AssigneeType', example='Agent'),
  categoryId?: string(name='CategoryId', example='43c2671b-****-4223-86d0-6bd187905cc8'),
  creator?: string(name='Creator', example='creator@cccV2-kmz'),
  customerId?: string(name='CustomerId', example='51e155ce-3747-*****-b402-13c69597b920'),
  endTime?: long(name='EndTime', example='1646928000000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobIdList?: string(name='JobIdList', example='["job-12******","job-23****"]'),
  pageNumber?: long(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: long(name='PageSize', description='This parameter is required.', example='10'),
  participant?: string(name='Participant', example='participant@cccV2-kmz'),
  startTime?: long(name='StartTime', example='1646841600000'),
  state?: string(name='State', example='Processing'),
  ticketId?: string(name='TicketId', example='5491d3b4-14ee-4341-b5f1-db2c78beddeb'),
  title?: string(name='Title'),
}

model ListTicketsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        assignee?: string(name='Assignee', example='assignee@ccc-test'),
        assigneeName?: string(name='AssigneeName', example='Assignee'),
        categoryId?: string(name='CategoryId', example='43c2671b-*****-4223-86d0-6bd187905cc8'),
        categoryName?: string(name='CategoryName'),
        closeCode?: string(name='CloseCode', example='Completed'),
        comment?: string(name='Comment'),
        context?: string(name='Context', example='{"productName":"alynx"}'),
        createdTime?: string(name='CreatedTime', example='1631440860000'),
        creator?: string(name='Creator', example='creator@ccc-test'),
        creatorName?: string(name='CreatorName', example='Creator'),
        currentTaskId?: string(name='CurrentTaskId', example='0707dab6-34a8-11ef-9823-161e3802b2d4'),
        currentTaskName?: string(name='CurrentTaskName'),
        currentTaskStartTime?: long(name='CurrentTaskStartTime', example='1631440860000'),
        customerId?: string(name='CustomerId', example='51e155ce-*****1-b402-13c69597b920'),
        endTime?: long(name='EndTime', example='1631440860000'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        jobId?: string(name='JobId', example='job-47150***150396416'),
        source?: string(name='Source', example='CHAT'),
        startTime?: long(name='StartTime', example='1631440860000'),
        state?: string(name='State', example='Processing'),
        templateId?: string(name='TemplateId', example='c844a5f0-496c-4c5b-8a0c-dd27686e8ff6'),
        templateVersion?: string(name='TemplateVersion', example='0'),
        ticketId?: string(name='TicketId', example='feb83abd-9f08-49d2-9b56-41d1b66ca0ac'),
        title?: string(name='Title'),
        updatedTime?: string(name='UpdatedTime', example='1631440860000'),
      }
    ](name='List'),
    pageNumber?: long(name='PageNumber', example='1'),
    pageSize?: long(name='PageSize', example='10'),
    totalCount?: long(name='TotalCount', example='10'),
  }(name='Data'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='7BEEA660-A45A-45E3-98CC-AFC65E715C23'),
}

model ListTicketsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTicketsResponseBody(name='body'),
}

/**
 * @param request ListTicketsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTicketsResponse
 */
async function listTicketsWithOptions(request: ListTicketsRequest, runtime: $RuntimeOptions): ListTicketsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.assignee)) {
    query['Assignee'] = request.assignee;
  }
  if (!$isNull(request.assigneeType)) {
    query['AssigneeType'] = request.assigneeType;
  }
  if (!$isNull(request.categoryId)) {
    query['CategoryId'] = request.categoryId;
  }
  if (!$isNull(request.creator)) {
    query['Creator'] = request.creator;
  }
  if (!$isNull(request.customerId)) {
    query['CustomerId'] = request.customerId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobIdList)) {
    query['JobIdList'] = request.jobIdList;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.participant)) {
    query['Participant'] = request.participant;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.state)) {
    query['State'] = request.state;
  }
  if (!$isNull(request.ticketId)) {
    query['TicketId'] = request.ticketId;
  }
  if (!$isNull(request.title)) {
    query['Title'] = request.title;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTickets',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListTicketsRequest
 * @return ListTicketsResponse
 */
async function listTickets(request: ListTicketsRequest): ListTicketsResponse {
  var runtime = new $RuntimeOptions{};
  return listTicketsWithOptions(request, runtime);
}

model ListUnassignedNumbersRequest {
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  searchPattern?: string(name='SearchPattern', example='0833'),
}

model ListUnassignedNumbersResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        city?: string(name='City'),
        number?: string(name='Number', example='08330011****'),
        province?: string(name='Province'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='3'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model ListUnassignedNumbersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUnassignedNumbersResponseBody(name='body'),
}

/**
 * @summary 获取未分配号码列表
 *
 * @param request ListUnassignedNumbersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUnassignedNumbersResponse
 */
async function listUnassignedNumbersWithOptions(request: ListUnassignedNumbersRequest, runtime: $RuntimeOptions): ListUnassignedNumbersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.searchPattern)) {
    query['SearchPattern'] = request.searchPattern;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListUnassignedNumbers',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取未分配号码列表
 *
 * @param request ListUnassignedNumbersRequest
 * @return ListUnassignedNumbersResponse
 */
async function listUnassignedNumbers(request: ListUnassignedNumbersRequest): ListUnassignedNumbersResponse {
  var runtime = new $RuntimeOptions{};
  return listUnassignedNumbersWithOptions(request, runtime);
}

model ListUserLevelsOfSkillGroupRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  isMember?: boolean(name='IsMember', description='This parameter is required.', example='true'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  searchPattern?: string(name='SearchPattern'),
  skillGroupId?: string(name='SkillGroupId', description='This parameter is required.', example='skillgroup@ccc-test'),
}

model ListUserLevelsOfSkillGroupResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        displayName?: string(name='DisplayName'),
        loginName?: string(name='LoginName', example='agent'),
        ramId?: string(name='RamId'),
        roleId?: string(name='RoleId', example='Admin@ccc-test'),
        roleName?: string(name='RoleName', example='Admin'),
        skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
        skillGroupName?: string(name='SkillGroupName', example='skillgroup'),
        skillLevel?: int32(name='SkillLevel', example='5'),
        userId?: string(name='UserId', example='agent@ccc-test'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ListUserLevelsOfSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUserLevelsOfSkillGroupResponseBody(name='body'),
}

/**
 * @param request ListUserLevelsOfSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUserLevelsOfSkillGroupResponse
 */
async function listUserLevelsOfSkillGroupWithOptions(request: ListUserLevelsOfSkillGroupRequest, runtime: $RuntimeOptions): ListUserLevelsOfSkillGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.isMember)) {
    query['IsMember'] = request.isMember;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.searchPattern)) {
    query['SearchPattern'] = request.searchPattern;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListUserLevelsOfSkillGroup',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListUserLevelsOfSkillGroupRequest
 * @return ListUserLevelsOfSkillGroupResponse
 */
async function listUserLevelsOfSkillGroup(request: ListUserLevelsOfSkillGroupRequest): ListUserLevelsOfSkillGroupResponse {
  var runtime = new $RuntimeOptions{};
  return listUserLevelsOfSkillGroupWithOptions(request, runtime);
}

model ListUsersRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  searchPattern?: string(name='SearchPattern', example='agent'),
  skillGroupId?: string(name='SkillGroupId'),
}

model ListUsersResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        deviceExt?: string(name='DeviceExt', example='8033****'),
        deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
        deviceState?: string(name='DeviceState', example='OFFLINE'),
        displayId?: string(name='DisplayId', example='1001'),
        displayName?: string(name='DisplayName'),
        email?: string(name='Email', example='username@example.com'),
        extension?: string(name='Extension', example='8031****'),
        loginName?: string(name='LoginName', example='agent'),
        mobile?: string(name='Mobile', example='1382114****'),
        personalOutboundNumberList?: [ 
          {
            active?: boolean(name='Active', example='true'),
            city?: string(name='City'),
            number?: string(name='Number', example='0830011****'),
            province?: string(name='Province'),
            usage?: string(name='Usage', example='Bidirection'),
          }
        ](name='PersonalOutboundNumberList'),
        primary?: boolean(name='Primary'),
        primaryAccount?: boolean(name='PrimaryAccount', example='false'),
        ramId?: long(name='RamId', example='21234502254620****'),
        roleId?: string(name='RoleId', example='Admin@ccc-test'),
        roleName?: string(name='RoleName', example='Admin'),
        skillLevelList?: [ 
          {
            skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
            skillGroupName?: string(name='SkillGroupName', example='skillgroup'),
            skillLevel?: int32(name='SkillLevel', example='5'),
          }
        ](name='SkillLevelList'),
        userId?: string(name='UserId', example='agent@ccc-test'),
        workMode?: string(name='WorkMode', example='ON_SITE'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ListUsersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUsersResponseBody(name='body'),
}

/**
 * @param request ListUsersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUsersResponse
 */
async function listUsersWithOptions(request: ListUsersRequest, runtime: $RuntimeOptions): ListUsersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.searchPattern)) {
    query['SearchPattern'] = request.searchPattern;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListUsers',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListUsersRequest
 * @return ListUsersResponse
 */
async function listUsers(request: ListUsersRequest): ListUsersResponse {
  var runtime = new $RuntimeOptions{};
  return listUsersWithOptions(request, runtime);
}

model ListVisitorChatMessagesRequest {
  accessChannelId?: string(name='AccessChannelId', example='cf584733-***-***-9699-cb77aa3b7aa6'),
  accessToken?: string(name='AccessToken', example='9XYGTGWtq2wXzVikKuip_zeVGl6O4VJ-l-*-*-JPofhap4P7fAevuE='),
  endTime?: string(name='EndTime', example='1650316799000'),
  instanceId?: string(name='InstanceId', example='ccc-test'),
  nextPageToken?: string(name='NextPageToken', example='1737193352340::7463707254.EAUNIT'),
  pageSize?: int32(name='PageSize', example='100'),
  sortOrder?: string(name='SortOrder', example='DESC'),
  startTime?: long(name='StartTime', example='1647325450000'),
  visitorId?: string(name='VisitorId', example='fcd020fe-****-1a272a174a7d'),
}

model ListVisitorChatMessagesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    messages?: [ 
      {
        content?: string(name='Content'),
        jobId?: string(name='JobId', example='chat-65382141036853491'),
        senderAvatarUrl?: string(name='SenderAvatarUrl', example='http://xxxxx.com/avatar.png'),
        senderId?: string(name='SenderId', example='fcd020fe-****-1a272a174a7d'),
        senderName?: string(name='SenderName'),
        senderType?: string(name='SenderType', example='CUSTOMER'),
        timestamp?: long(name='Timestamp', example='1696126980371'),
      }
    ](name='Messages'),
    nextPageToken?: string(name='NextPageToken', example='1737193352340::7463707254.EAUNIT'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', description='Id of the request', example='8707EB29-BAED-4302-B999-40BA61877437'),
}

model ListVisitorChatMessagesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListVisitorChatMessagesResponseBody(name='body'),
}

/**
 * @summary ListVisitorChatMessages
 *
 * @param request ListVisitorChatMessagesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListVisitorChatMessagesResponse
 */
async function listVisitorChatMessagesWithOptions(request: ListVisitorChatMessagesRequest, runtime: $RuntimeOptions): ListVisitorChatMessagesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accessChannelId)) {
    query['AccessChannelId'] = request.accessChannelId;
  }
  if (!$isNull(request.accessToken)) {
    query['AccessToken'] = request.accessToken;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.nextPageToken)) {
    query['NextPageToken'] = request.nextPageToken;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.visitorId)) {
    query['VisitorId'] = request.visitorId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListVisitorChatMessages',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary ListVisitorChatMessages
 *
 * @param request ListVisitorChatMessagesRequest
 * @return ListVisitorChatMessagesResponse
 */
async function listVisitorChatMessages(request: ListVisitorChatMessagesRequest): ListVisitorChatMessagesResponse {
  var runtime = new $RuntimeOptions{};
  return listVisitorChatMessagesWithOptions(request, runtime);
}

model ListVoicemailsRequest {
  caller?: string(name='Caller', example='073xxxx7539'),
  contactId?: string(name='ContactId', example='job-125152394144124921'),
  endTime?: long(name='EndTime', example='1532707199000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  name?: string(name='Name', example='voicemail-test', deprecated=true),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  startTime?: long(name='StartTime', example='1532448000000'),
}

model ListVoicemailsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        callee?: string(name='Callee', example='0533128****'),
        caller?: string(name='Caller', example='073xxxx7539'),
        cdrStartTime?: long(name='CdrStartTime'),
        contactId?: string(name='ContactId', example='job-125152394144124921'),
        duration?: long(name='Duration', example='16'),
        instanceId?: string(name='InstanceId', example='ccc-test'),
        name?: string(name='Name', example='voicemail-test'),
        recordingDuration?: long(name='RecordingDuration'),
        startTime?: string(name='StartTime', example='1631440860000'),
      }
    ](name='List'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='11'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ListVoicemailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListVoicemailsResponseBody(name='body'),
}

/**
 * @param request ListVoicemailsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListVoicemailsResponse
 */
async function listVoicemailsWithOptions(request: ListVoicemailsRequest, runtime: $RuntimeOptions): ListVoicemailsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.caller)) {
    query['Caller'] = request.caller;
  }
  if (!$isNull(request.contactId)) {
    query['ContactId'] = request.contactId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListVoicemails',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListVoicemailsRequest
 * @return ListVoicemailsResponse
 */
async function listVoicemails(request: ListVoicemailsRequest): ListVoicemailsResponse {
  var runtime = new $RuntimeOptions{};
  return listVoicemailsWithOptions(request, runtime);
}

model ListWaitingChatsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  skillGroupIdList?: string(name='SkillGroupIdList', example='["skillgroup1@ccc-test", "skillgroup2@ccc-test"]'),
}

model ListWaitingChatsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      accessChannelId?: string(name='AccessChannelId', example='843073c2-*****-49fb-a616-738ddddfebdc'),
      accessChannelType?: string(name='AccessChannelType', example='Web'),
      beingAssigned?: boolean(name='BeingAssigned', example='false'),
      chatConversationId?: string(name='ChatConversationId', example='$23086709$EAUNIT'),
      enqueueTime?: long(name='EnqueueTime', example='1718868572094'),
      jobId?: string(name='JobId', example='chat-434537064047960064'),
      messages?: [ 
        {
          content?: string(name='Content'),
          senderId?: string(name='SenderId', example='c361765f-******-4e07-b81c-4b5d9183fac6'),
          senderType?: string(name='SenderType'),
        }
      ](name='Messages'),
      skillGroupId?: string(name='SkillGroupId'),
      userList?: [ 
        {
          avatarUrl?: string(name='AvatarUrl'),
          userId?: string(name='UserId', example='c361765f-******-4e07-b81c-4b5d9183fac6'),
          userName?: string(name='UserName'),
          userType?: string(name='UserType', example='CUSTOMER'),
        }
      ](name='UserList'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='03C67DAD-EB26-41D8-949D-9B0C470FB716'),
}

model ListWaitingChatsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWaitingChatsResponseBody(name='body'),
}

/**
 * @param request ListWaitingChatsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWaitingChatsResponse
 */
async function listWaitingChatsWithOptions(request: ListWaitingChatsRequest, runtime: $RuntimeOptions): ListWaitingChatsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.skillGroupIdList)) {
    query['SkillGroupIdList'] = request.skillGroupIdList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListWaitingChats',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListWaitingChatsRequest
 * @return ListWaitingChatsResponse
 */
async function listWaitingChats(request: ListWaitingChatsRequest): ListWaitingChatsResponse {
  var runtime = new $RuntimeOptions{};
  return listWaitingChatsWithOptions(request, runtime);
}

model MakeCallRequest {
  callee?: string(name='Callee', description='This parameter is required.', example='1318888****'),
  caller?: string(name='Caller', example='010989****'),
  deviceId?: string(name='DeviceId', example='device'),
  flashSmsVariables?: string(name='FlashSmsVariables'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  maskedCallee?: string(name='MaskedCallee', example='131****8888'),
  mediaType?: string(name='MediaType'),
  tags?: string(name='Tags', example='tags'),
  timeoutSeconds?: int32(name='TimeoutSeconds', example='30'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model MakeCallResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      callVariables?: string(name='CallVariables'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelFlags?: string(name='ChannelFlags', example='MONITORING'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-653821410368****'),
          channelState?: string(name='ChannelState', example='NONE'),
          destination?: string(name='Destination', example='8001****'),
          jobId?: string(name='JobId', example='job-6570007401392****'),
          mediaType?: string(name='MediaType'),
          originator?: string(name='Originator', example='1318888****'),
          releaseInitiator?: string(name='ReleaseInitiator'),
          releaseReason?: string(name='ReleaseReason'),
          timestamp?: long(name='Timestamp', example='1609225718295'),
          userExtension?: string(name='UserExtension', example='8001****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6570007401392****'),
    }(name='CallContext'),
    contextId?: long(name='ContextId', example='123456'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8001****'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6570007401392****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='READY'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='26A34338-5CD9-4C95-A7A6-5BDCE76C6B94'),
}

model MakeCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MakeCallResponseBody(name='body'),
}

/**
 * @param request MakeCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MakeCallResponse
 */
async function makeCallWithOptions(request: MakeCallRequest, runtime: $RuntimeOptions): MakeCallResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.callee)) {
    query['Callee'] = request.callee;
  }
  if (!$isNull(request.caller)) {
    query['Caller'] = request.caller;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.flashSmsVariables)) {
    query['FlashSmsVariables'] = request.flashSmsVariables;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.maskedCallee)) {
    query['MaskedCallee'] = request.maskedCallee;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!$isNull(request.timeoutSeconds)) {
    query['TimeoutSeconds'] = request.timeoutSeconds;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'MakeCall',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request MakeCallRequest
 * @return MakeCallResponse
 */
async function makeCall(request: MakeCallRequest): MakeCallResponse {
  var runtime = new $RuntimeOptions{};
  return makeCallWithOptions(request, runtime);
}

model ModifyAudioFileRequest {
  audioFileName?: string(name='AudioFileName', description='This parameter is required.', example='new-test-file.wav'),
  audioResourceId?: string(name='AudioResourceId', description='This parameter is required.', example='acc300c4-75c9-41ba-ba5e-2a365c96c248'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  name?: string(name='Name', description='This parameter is required.'),
  ossFileKey?: string(name='OssFileKey', description='This parameter is required.', example='ccc-test/new-test-file.wav'),
  usage?: string(name='Usage'),
}

model ModifyAudioFileResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='D2F84AAC-7C79-547F-8EE9-7B735F42B93F'),
}

model ModifyAudioFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAudioFileResponseBody(name='body'),
}

/**
 * @param request ModifyAudioFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAudioFileResponse
 */
async function modifyAudioFileWithOptions(request: ModifyAudioFileRequest, runtime: $RuntimeOptions): ModifyAudioFileResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.audioFileName)) {
    query['AudioFileName'] = request.audioFileName;
  }
  if (!$isNull(request.audioResourceId)) {
    query['AudioResourceId'] = request.audioResourceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.ossFileKey)) {
    query['OssFileKey'] = request.ossFileKey;
  }
  if (!$isNull(request.usage)) {
    query['Usage'] = request.usage;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyAudioFile',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyAudioFileRequest
 * @return ModifyAudioFileResponse
 */
async function modifyAudioFile(request: ModifyAudioFileRequest): ModifyAudioFileResponse {
  var runtime = new $RuntimeOptions{};
  return modifyAudioFileWithOptions(request, runtime);
}

model ModifyCustomCallTaggingRequest {
  callTagNameList?: string(name='CallTagNameList', example='["TagA","TagB"]'),
  description?: string(name='Description'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  number?: string(name='Number', description='This parameter is required.', example='1312121****'),
}

model ModifyCustomCallTaggingResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model ModifyCustomCallTaggingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyCustomCallTaggingResponseBody(name='body'),
}

/**
 * @summary 编辑呼入控制号码
 *
 * @param request ModifyCustomCallTaggingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyCustomCallTaggingResponse
 */
async function modifyCustomCallTaggingWithOptions(request: ModifyCustomCallTaggingRequest, runtime: $RuntimeOptions): ModifyCustomCallTaggingResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.callTagNameList)) {
    query['CallTagNameList'] = request.callTagNameList;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.number)) {
    query['Number'] = request.number;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyCustomCallTagging',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 编辑呼入控制号码
 *
 * @param request ModifyCustomCallTaggingRequest
 * @return ModifyCustomCallTaggingResponse
 */
async function modifyCustomCallTagging(request: ModifyCustomCallTaggingRequest): ModifyCustomCallTaggingResponse {
  var runtime = new $RuntimeOptions{};
  return modifyCustomCallTaggingWithOptions(request, runtime);
}

model ModifyInstanceRequest {
  description?: string(name='Description'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model ModifyInstanceResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='83TKE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ModifyInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceResponseBody(name='body'),
}

/**
 * @param request ModifyInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceResponse
 */
async function modifyInstanceWithOptions(request: ModifyInstanceRequest, runtime: $RuntimeOptions): ModifyInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyInstance',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyInstanceRequest
 * @return ModifyInstanceResponse
 */
async function modifyInstance(request: ModifyInstanceRequest): ModifyInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return modifyInstanceWithOptions(request, runtime);
}

model ModifyPhoneNumberRequest {
  contactFlowId?: string(name='ContactFlowId', example='78128960-bb00-4ddc-8a82-923a8c5bd22d'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  number?: string(name='Number', description='This parameter is required.', example='0102134****'),
  usage?: string(name='Usage', description='This parameter is required.', example='Bidirection'),
}

model ModifyPhoneNumberResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ModifyPhoneNumberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyPhoneNumberResponseBody(name='body'),
}

/**
 * @param request ModifyPhoneNumberRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyPhoneNumberResponse
 */
async function modifyPhoneNumberWithOptions(request: ModifyPhoneNumberRequest, runtime: $RuntimeOptions): ModifyPhoneNumberResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactFlowId)) {
    query['ContactFlowId'] = request.contactFlowId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.number)) {
    query['Number'] = request.number;
  }
  if (!$isNull(request.usage)) {
    query['Usage'] = request.usage;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyPhoneNumber',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyPhoneNumberRequest
 * @return ModifyPhoneNumberResponse
 */
async function modifyPhoneNumber(request: ModifyPhoneNumberRequest): ModifyPhoneNumberResponse {
  var runtime = new $RuntimeOptions{};
  return modifyPhoneNumberWithOptions(request, runtime);
}

model ModifySkillGroupRequest {
  description?: string(name='Description'),
  displayName?: string(name='DisplayName'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  skillGroupId?: string(name='SkillGroupId', description='This parameter is required.', example='skillgroup@ccc-test'),
}

model ModifySkillGroupResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ModifySkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifySkillGroupResponseBody(name='body'),
}

/**
 * @param request ModifySkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifySkillGroupResponse
 */
async function modifySkillGroupWithOptions(request: ModifySkillGroupRequest, runtime: $RuntimeOptions): ModifySkillGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.displayName)) {
    query['DisplayName'] = request.displayName;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifySkillGroup',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifySkillGroupRequest
 * @return ModifySkillGroupResponse
 */
async function modifySkillGroup(request: ModifySkillGroupRequest): ModifySkillGroupResponse {
  var runtime = new $RuntimeOptions{};
  return modifySkillGroupWithOptions(request, runtime);
}

model ModifySkillLevelsOfUserRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  skillLevelList?: string(name='SkillLevelList', description='This parameter is required.', example='[{"skillGroupId":"skillgroup1@ccc-test","skillLevel":1},{"skillGroupId":"skillgroup2@ccc-test","skillLevel":10}]'),
  userId?: string(name='UserId', description='This parameter is required.', example='agent@ccc-test'),
}

model ModifySkillLevelsOfUserResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='E49D8B83-A3EC-44D4-A920-578BC3C698AD'),
}

model ModifySkillLevelsOfUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifySkillLevelsOfUserResponseBody(name='body'),
}

/**
 * @param request ModifySkillLevelsOfUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifySkillLevelsOfUserResponse
 */
async function modifySkillLevelsOfUserWithOptions(request: ModifySkillLevelsOfUserRequest, runtime: $RuntimeOptions): ModifySkillLevelsOfUserResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.skillLevelList)) {
    query['SkillLevelList'] = request.skillLevelList;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifySkillLevelsOfUser',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifySkillLevelsOfUserRequest
 * @return ModifySkillLevelsOfUserResponse
 */
async function modifySkillLevelsOfUser(request: ModifySkillLevelsOfUserRequest): ModifySkillLevelsOfUserResponse {
  var runtime = new $RuntimeOptions{};
  return modifySkillLevelsOfUserWithOptions(request, runtime);
}

model ModifyUserRequest {
  avatarUrl?: string(name='AvatarUrl'),
  displayId?: string(name='DisplayId', example='1001'),
  displayName?: string(name='DisplayName'),
  force?: boolean(name='Force'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  mobile?: string(name='Mobile', example='1382114****'),
  nickname?: string(name='Nickname'),
  roleId?: string(name='RoleId', example='Admin@ccc-test'),
  userId?: string(name='UserId', description='This parameter is required.', example='user-test@ccc-test'),
  workMode?: string(name='WorkMode', description='This parameter is required.', example='ON_SITE'),
}

model ModifyUserResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ModifyUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyUserResponseBody(name='body'),
}

/**
 * @param request ModifyUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyUserResponse
 */
async function modifyUserWithOptions(request: ModifyUserRequest, runtime: $RuntimeOptions): ModifyUserResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.avatarUrl)) {
    query['AvatarUrl'] = request.avatarUrl;
  }
  if (!$isNull(request.displayId)) {
    query['DisplayId'] = request.displayId;
  }
  if (!$isNull(request.displayName)) {
    query['DisplayName'] = request.displayName;
  }
  if (!$isNull(request.force)) {
    query['Force'] = request.force;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.mobile)) {
    query['Mobile'] = request.mobile;
  }
  if (!$isNull(request.nickname)) {
    query['Nickname'] = request.nickname;
  }
  if (!$isNull(request.roleId)) {
    query['RoleId'] = request.roleId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  if (!$isNull(request.workMode)) {
    query['WorkMode'] = request.workMode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyUser',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyUserRequest
 * @return ModifyUserResponse
 */
async function modifyUser(request: ModifyUserRequest): ModifyUserResponse {
  var runtime = new $RuntimeOptions{};
  return modifyUserWithOptions(request, runtime);
}

model ModifyUserLevelsOfSkillGroupRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  skillGroupId?: string(name='SkillGroupId', description='This parameter is required.', example='skillgroup@ccc-test'),
  userLevelList?: string(name='UserLevelList', description='This parameter is required.', example='[{"userId":"agent1@ccc-test","skillLevel":1},{"userId":"agent2@ccc-test","skillLevel":10}]'),
}

model ModifyUserLevelsOfSkillGroupResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='E49D8B83-A3EC-44D4-A920-578BC3C698AD'),
}

model ModifyUserLevelsOfSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyUserLevelsOfSkillGroupResponseBody(name='body'),
}

/**
 * @param request ModifyUserLevelsOfSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyUserLevelsOfSkillGroupResponse
 */
async function modifyUserLevelsOfSkillGroupWithOptions(request: ModifyUserLevelsOfSkillGroupRequest, runtime: $RuntimeOptions): ModifyUserLevelsOfSkillGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  if (!$isNull(request.userLevelList)) {
    query['UserLevelList'] = request.userLevelList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyUserLevelsOfSkillGroup',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyUserLevelsOfSkillGroupRequest
 * @return ModifyUserLevelsOfSkillGroupResponse
 */
async function modifyUserLevelsOfSkillGroup(request: ModifyUserLevelsOfSkillGroupRequest): ModifyUserLevelsOfSkillGroupResponse {
  var runtime = new $RuntimeOptions{};
  return modifyUserLevelsOfSkillGroupWithOptions(request, runtime);
}

model MonitorCallRequest {
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  monitoredUserId?: string(name='MonitoredUserId', description='This parameter is required.', example='agent2@ccc-test'),
  timeoutSeconds?: int32(name='TimeoutSeconds', example='30'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model MonitorCallResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelFlags?: string(name='ChannelFlags', example='MONITORING'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-653821410368****'),
          channelState?: string(name='ChannelState', example='CREATED'),
          destination?: string(name='Destination', example='1390501****'),
          index?: int32(name='Index', example='1'),
          jobId?: string(name='JobId', example='job-6538214103685****'),
          originator?: string(name='Originator', example='0830019****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
          timestamp?: long(name='Timestamp', example='1609138903315'),
          userExtension?: string(name='UserExtension', example='8032****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8032****'),
      heartbeat?: long(name='Heartbeat', example='1609136956378'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
      mobile?: string(name='Mobile', example='1324730****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1609136956378'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='BREAK'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model MonitorCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MonitorCallResponseBody(name='body'),
}

/**
 * @param request MonitorCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MonitorCallResponse
 */
async function monitorCallWithOptions(request: MonitorCallRequest, runtime: $RuntimeOptions): MonitorCallResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.monitoredUserId)) {
    query['MonitoredUserId'] = request.monitoredUserId;
  }
  if (!$isNull(request.timeoutSeconds)) {
    query['TimeoutSeconds'] = request.timeoutSeconds;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'MonitorCall',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request MonitorCallRequest
 * @return MonitorCallResponse
 */
async function monitorCall(request: MonitorCallRequest): MonitorCallResponse {
  var runtime = new $RuntimeOptions{};
  return monitorCallWithOptions(request, runtime);
}

model MuteCallRequest {
  channelId?: string(name='ChannelId', example='ch:user:1318888****->8001****:1609253204816:job-6581536084722****'),
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-6581536084722****'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model MuteCallResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelFlags?: string(name='ChannelFlags', example='[]'),
          channelId?: string(name='ChannelId', example='ch:user:1318888****->8001****:1609253204816:job-6581536084722****'),
          channelState?: string(name='ChannelState', example='ANSWERED'),
          destination?: string(name='Destination', example='8001****'),
          index?: int32(name='Index', example='1'),
          jobId?: string(name='JobId', example='job-6581536084722****'),
          originator?: string(name='Originator', example='1318888****'),
          releaseInitiator?: string(name='ReleaseInitiator'),
          releaseReason?: string(name='ReleaseReason'),
          skillGroupId?: string(name='SkillGroupId'),
          timestamp?: long(name='Timestamp', example='1609253212511'),
          userExtension?: string(name='UserExtension', example='8001****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6581536084722****'),
    }(name='CallContext'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8001****'),
      heartbeat?: long(name='Heartbeat', example='1609253205896'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6581536084722****'),
      mobile?: string(name='Mobile', example='1390000****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1609253204811'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='A275B008-A25B-494D-AB53-93CE253815B6'),
}

model MuteCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MuteCallResponseBody(name='body'),
}

/**
 * @param request MuteCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MuteCallResponse
 */
async function muteCallWithOptions(request: MuteCallRequest, runtime: $RuntimeOptions): MuteCallResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.channelId)) {
    query['ChannelId'] = request.channelId;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'MuteCall',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request MuteCallRequest
 * @return MuteCallResponse
 */
async function muteCall(request: MuteCallRequest): MuteCallResponse {
  var runtime = new $RuntimeOptions{};
  return muteCallWithOptions(request, runtime);
}

model PauseCampaignRequest {
  campaignId?: string(name='CampaignId', description='This parameter is required.', example='6badb397-a8b5-40b6-21019d382a09'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model PauseCampaignResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: string(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='4A68E287-6888-5ADB-8048-DB488B4DEF35'),
}

model PauseCampaignResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PauseCampaignResponseBody(name='body'),
}

/**
 * @summary 暂停预测式外呼活动
 *
 * @param request PauseCampaignRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PauseCampaignResponse
 */
async function pauseCampaignWithOptions(request: PauseCampaignRequest, runtime: $RuntimeOptions): PauseCampaignResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.campaignId)) {
    query['CampaignId'] = request.campaignId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'PauseCampaign',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 暂停预测式外呼活动
 *
 * @param request PauseCampaignRequest
 * @return PauseCampaignResponse
 */
async function pauseCampaign(request: PauseCampaignRequest): PauseCampaignResponse {
  var runtime = new $RuntimeOptions{};
  return pauseCampaignWithOptions(request, runtime);
}

model PickOutboundNumbersRequest {
  calledNumber?: string(name='CalledNumber', description='This parameter is required.', example='1388888****'),
  count?: int32(name='Count', example='1'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  skillGroupIdList?: string(name='SkillGroupIdList', description='This parameter is required.', example='["skillgroup@ccc-test"]'),
}

model PickOutboundNumbersResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      callee?: {
        city?: string(name='City'),
        number?: string(name='Number', example='1388888****'),
        province?: string(name='Province'),
      }(name='Callee'),
      caller?: {
        city?: string(name='City'),
        number?: string(name='Number', example='0108989****'),
        province?: string(name='Province'),
      }(name='Caller'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model PickOutboundNumbersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PickOutboundNumbersResponseBody(name='body'),
}

/**
 * @param request PickOutboundNumbersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PickOutboundNumbersResponse
 */
async function pickOutboundNumbersWithOptions(request: PickOutboundNumbersRequest, runtime: $RuntimeOptions): PickOutboundNumbersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!$isNull(request.count)) {
    query['Count'] = request.count;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.skillGroupIdList)) {
    query['SkillGroupIdList'] = request.skillGroupIdList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'PickOutboundNumbers',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request PickOutboundNumbersRequest
 * @return PickOutboundNumbersResponse
 */
async function pickOutboundNumbers(request: PickOutboundNumbersRequest): PickOutboundNumbersResponse {
  var runtime = new $RuntimeOptions{};
  return pickOutboundNumbersWithOptions(request, runtime);
}

model PollUserStatusRequest {
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model PollUserStatusResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      callVariables?: string(name='CallVariables', example='a=b;c=d'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelFlags?: string(name='ChannelFlags', example='MONITORING'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-653821410368****'),
          channelState?: string(name='ChannelState', example='CREATED'),
          channelVariables?: string(name='ChannelVariables', example='123'),
          destination?: string(name='Destination', example='1390501****'),
          index?: int32(name='Index', example='1'),
          jobId?: string(name='JobId', example='job-6538214103685****'),
          originator?: string(name='Originator', example='0830019****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
          timestamp?: long(name='Timestamp', example='1609138903315'),
          userExtension?: string(name='UserExtension', example='8032****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    chatContexts?: [ 
      {
        callVariables?: string(name='CallVariables'),
        chatType?: string(name='ChatType'),
        instanceId?: string(name='InstanceId'),
        jobId?: string(name='JobId'),
        members?: [ 
          {
            index?: int32(name='Index'),
            releaseInitiator?: string(name='ReleaseInitiator'),
            releaseReason?: string(name='ReleaseReason'),
            skillGroupId?: string(name='SkillGroupId'),
            status?: string(name='Status'),
            userId?: string(name='UserId'),
            userType?: string(name='UserType'),
          }
        ](name='Members'),
      }
    ](name='ChatContexts'),
    contextId?: long(name='ContextId', example='103655'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8032****'),
      heartbeat?: long(name='Heartbeat', example='1609136956378'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
      mobile?: string(name='Mobile', example='1324730****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      parallelJobList?: [ 
        {
          jobId?: string(name='JobId'),
          status?: string(name='Status'),
          timestamp?: long(name='Timestamp'),
        }
      ](name='ParallelJobList'),
      reserved?: long(name='Reserved', example='1609136956378'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='BREAK'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model PollUserStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PollUserStatusResponseBody(name='body'),
}

/**
 * @param request PollUserStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PollUserStatusResponse
 */
async function pollUserStatusWithOptions(request: PollUserStatusRequest, runtime: $RuntimeOptions): PollUserStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'PollUserStatus',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request PollUserStatusRequest
 * @return PollUserStatusResponse
 */
async function pollUserStatus(request: PollUserStatusRequest): PollUserStatusResponse {
  var runtime = new $RuntimeOptions{};
  return pollUserStatusWithOptions(request, runtime);
}

model ProcessAliMeCallbackOfStagingRequest {
  data?: string(name='Data'),
  token?: string(name='Token'),
}

model ProcessAliMeCallbackOfStagingResponseBody = {
  code?: string(name='Code'),
  data?: {
    result?: string(name='Result'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model ProcessAliMeCallbackOfStagingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ProcessAliMeCallbackOfStagingResponseBody(name='body'),
}

/**
 * @summary ProcessAliMeCallbackOfStaging
 *
 * @param request ProcessAliMeCallbackOfStagingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ProcessAliMeCallbackOfStagingResponse
 */
async function processAliMeCallbackOfStagingWithOptions(request: ProcessAliMeCallbackOfStagingRequest, runtime: $RuntimeOptions): ProcessAliMeCallbackOfStagingResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.data)) {
    query['Data'] = request.data;
  }
  if (!$isNull(request.token)) {
    query['Token'] = request.token;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ProcessAliMeCallbackOfStaging',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary ProcessAliMeCallbackOfStaging
 *
 * @param request ProcessAliMeCallbackOfStagingRequest
 * @return ProcessAliMeCallbackOfStagingResponse
 */
async function processAliMeCallbackOfStaging(request: ProcessAliMeCallbackOfStagingRequest): ProcessAliMeCallbackOfStagingResponse {
  var runtime = new $RuntimeOptions{};
  return processAliMeCallbackOfStagingWithOptions(request, runtime);
}

model ProcessCustomIMCallbackRequest {
  accessChannelId?: string(name='AccessChannelId', description='This parameter is required.', example='cf584733-***-***-9699-cb77aa3b7aa6'),
  conversationId?: string(name='ConversationId', description='This parameter is required.', example='d165de4f-9851-445e-9535-66ebfa72fa51'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='9cfad875-6260-4a53-ab6e-b13e3fb31f7d'),
  messageContent?: string(name='MessageContent', description='This parameter is required.'),
  requestId?: string(name='RequestId', example='03C67DAD-EB26-41D8-949D-9B0C470FB716'),
  senderAvatarMediaId?: string(name='SenderAvatarMediaId', example='xxxx'),
  senderId?: string(name='SenderId', description='This parameter is required.', example='63061274befd6b545aab4c83'),
  senderName?: string(name='SenderName', example='tom'),
}

model ProcessCustomIMCallbackResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  jobId?: string(name='JobId', example='chat-65382141036853491'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='2778FA12-EDD6-42AA-9B15-AF855072E5E5'),
}

model ProcessCustomIMCallbackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ProcessCustomIMCallbackResponseBody(name='body'),
}

/**
 * @param request ProcessCustomIMCallbackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ProcessCustomIMCallbackResponse
 */
async function processCustomIMCallbackWithOptions(request: ProcessCustomIMCallbackRequest, runtime: $RuntimeOptions): ProcessCustomIMCallbackResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.accessChannelId)) {
    body['AccessChannelId'] = request.accessChannelId;
  }
  if (!$isNull(request.conversationId)) {
    body['ConversationId'] = request.conversationId;
  }
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.messageContent)) {
    body['MessageContent'] = request.messageContent;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  if (!$isNull(request.senderAvatarMediaId)) {
    body['SenderAvatarMediaId'] = request.senderAvatarMediaId;
  }
  if (!$isNull(request.senderId)) {
    body['SenderId'] = request.senderId;
  }
  if (!$isNull(request.senderName)) {
    body['SenderName'] = request.senderName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ProcessCustomIMCallback',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ProcessCustomIMCallbackRequest
 * @return ProcessCustomIMCallbackResponse
 */
async function processCustomIMCallback(request: ProcessCustomIMCallbackRequest): ProcessCustomIMCallbackResponse {
  var runtime = new $RuntimeOptions{};
  return processCustomIMCallbackWithOptions(request, runtime);
}

model PublishContactFlowRequest {
  contactFlowId?: string(name='ContactFlowId', description='This parameter is required.', example='b0a063bf-f138-42a4-ad9f-9babe3ec1a9e'),
  draftId?: string(name='DraftId', description='This parameter is required.', example='0e0b8e78-af3e-4360-a5c5-f9bb5c2b8af2'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model PublishContactFlowResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BFB6788F-20D4-5767-BC67-99EAAC28F789'),
}

model PublishContactFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PublishContactFlowResponseBody(name='body'),
}

/**
 * @param request PublishContactFlowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PublishContactFlowResponse
 */
async function publishContactFlowWithOptions(request: PublishContactFlowRequest, runtime: $RuntimeOptions): PublishContactFlowResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactFlowId)) {
    query['ContactFlowId'] = request.contactFlowId;
  }
  if (!$isNull(request.draftId)) {
    query['DraftId'] = request.draftId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'PublishContactFlow',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request PublishContactFlowRequest
 * @return PublishContactFlowResponse
 */
async function publishContactFlow(request: PublishContactFlowRequest): PublishContactFlowResponse {
  var runtime = new $RuntimeOptions{};
  return publishContactFlowWithOptions(request, runtime);
}

model ReadyForServiceRequest {
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  outboundScenario?: boolean(name='OutboundScenario', example='false'),
  userId?: string(name='UserId', example='user-test@ccc-test'),
}

model ReadyForServiceResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    breakCode?: string(name='BreakCode', example='Warm-up'),
    deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
    extension?: string(name='Extension', example='8001****'),
    instanceId?: string(name='InstanceId', example='ccc-test'),
    jobId?: string(name='JobId', example='job-6538214103685****'),
    outboundScenario?: boolean(name='OutboundScenario', example='false'),
    signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
    userId?: string(name='UserId', example='agent@ccc-test'),
    userState?: string(name='UserState', example='READY'),
    workMode?: string(name='WorkMode', example='ON_SITE'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='CC49060B-87ED-489A-AD3D-00E57775DBFF'),
}

model ReadyForServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReadyForServiceResponseBody(name='body'),
}

/**
 * @param request ReadyForServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReadyForServiceResponse
 */
async function readyForServiceWithOptions(request: ReadyForServiceRequest, runtime: $RuntimeOptions): ReadyForServiceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.outboundScenario)) {
    query['OutboundScenario'] = request.outboundScenario;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ReadyForService',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ReadyForServiceRequest
 * @return ReadyForServiceResponse
 */
async function readyForService(request: ReadyForServiceRequest): ReadyForServiceResponse {
  var runtime = new $RuntimeOptions{};
  return readyForServiceWithOptions(request, runtime);
}

model RedialCallRequest {
  callee?: string(name='Callee', example='1318888****'),
  caller?: string(name='Caller', example='0109810****'),
  deviceId?: string(name='DeviceId'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='abc'),
  jobId?: string(name='JobId', example='job-6581536084722****'),
  tags?: string(name='Tags', example='a=b'),
  timeoutSeconds?: int32(name='TimeoutSeconds', example='30'),
  userId?: string(name='UserId', example='samzhang@abc'),
}

model RedialCallResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelFlags?: string(name='ChannelFlags', example='COACHING'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-653821410368****'),
          channelState?: string(name='ChannelState', example='CREATED'),
          destination?: string(name='Destination', example='8001****'),
          jobId?: string(name='JobId', example='job-6573574060089****'),
          originator?: string(name='Originator', example='1318888****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='139xxxx0501'),
          releaseReason?: string(name='ReleaseReason', example='486:USER_BUSY'),
          timestamp?: long(name='Timestamp', example='1609138903315'),
          userExtension?: string(name='UserExtension', example='8000****'),
          userId?: string(name='UserId', example='samzhang@abc'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='abc'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    contextId?: long(name='ContextId', example='123456789'),
    userContext?: {
      breakCode?: string(name='BreakCode'),
      deviceId?: string(name='DeviceId'),
      extension?: string(name='Extension', example='8000****'),
      instanceId?: string(name='InstanceId', example='abc'),
      jobId?: string(name='JobId', example='job-6573574060089****'),
      outboundScenario?: boolean(name='OutboundScenario', example='False'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='samzhang@abc'),
      userState?: string(name='UserState'),
      workMode?: string(name='WorkMode'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='BF268B34-09C2-43FD-BAC4-5D31EA63****'),
}

model RedialCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RedialCallResponseBody(name='body'),
}

/**
 * @param request RedialCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RedialCallResponse
 */
async function redialCallWithOptions(request: RedialCallRequest, runtime: $RuntimeOptions): RedialCallResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.callee)) {
    query['Callee'] = request.callee;
  }
  if (!$isNull(request.caller)) {
    query['Caller'] = request.caller;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!$isNull(request.timeoutSeconds)) {
    query['TimeoutSeconds'] = request.timeoutSeconds;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RedialCall',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RedialCallRequest
 * @return RedialCallResponse
 */
async function redialCall(request: RedialCallRequest): RedialCallResponse {
  var runtime = new $RuntimeOptions{};
  return redialCallWithOptions(request, runtime);
}

model RegisterDeviceRequest {
  deviceId?: string(name='DeviceId', description='This parameter is required.', example='test-device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  password?: string(name='Password', description='This parameter is required.', example='password'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model RegisterDeviceResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model RegisterDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RegisterDeviceResponseBody(name='body'),
}

/**
 * @param request RegisterDeviceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RegisterDeviceResponse
 */
async function registerDeviceWithOptions(request: RegisterDeviceRequest, runtime: $RuntimeOptions): RegisterDeviceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.password)) {
    query['Password'] = request.password;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RegisterDevice',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RegisterDeviceRequest
 * @return RegisterDeviceResponse
 */
async function registerDevice(request: RegisterDeviceRequest): RegisterDeviceResponse {
  var runtime = new $RuntimeOptions{};
  return registerDeviceWithOptions(request, runtime);
}

model RegisterDevicesRequest {
  deviceId?: string(name='DeviceId', description='This parameter is required.', example='test-device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  password?: string(name='Password', description='This parameter is required.', example='password'),
  userIdListJson?: string(name='UserIdListJson', example='["user-test@ccc-test"]'),
}

model RegisterDevicesResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model RegisterDevicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RegisterDevicesResponseBody(name='body'),
}

/**
 * @param request RegisterDevicesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RegisterDevicesResponse
 */
async function registerDevicesWithOptions(request: RegisterDevicesRequest, runtime: $RuntimeOptions): RegisterDevicesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.password)) {
    query['Password'] = request.password;
  }
  if (!$isNull(request.userIdListJson)) {
    query['UserIdListJson'] = request.userIdListJson;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RegisterDevices',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RegisterDevicesRequest
 * @return RegisterDevicesResponse
 */
async function registerDevices(request: RegisterDevicesRequest): RegisterDevicesResponse {
  var runtime = new $RuntimeOptions{};
  return registerDevicesWithOptions(request, runtime);
}

model RejectChatRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='chat-65382141036853491'),
}

model RejectChatResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='B59382D2-5755-4C6D-861F-FA2AAD8F89F7'),
}

model RejectChatResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RejectChatResponseBody(name='body'),
}

/**
 * @param request RejectChatRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RejectChatResponse
 */
async function rejectChatWithOptions(request: RejectChatRequest, runtime: $RuntimeOptions): RejectChatResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RejectChat',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RejectChatRequest
 * @return RejectChatResponse
 */
async function rejectChat(request: RejectChatRequest): RejectChatResponse {
  var runtime = new $RuntimeOptions{};
  return rejectChatWithOptions(request, runtime);
}

model RejectTicketRequest {
  comment?: string(name='Comment'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  ticketId?: string(name='TicketId', example='f2c6722b-cd13-442d-bf10-22a07c70d6d5'),
}

model RejectTicketResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: any(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='678F7002-CA01-4ABF-A112-585AFBDF3A3B'),
}

model RejectTicketResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RejectTicketResponseBody(name='body'),
}

/**
 * @param request RejectTicketRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RejectTicketResponse
 */
async function rejectTicketWithOptions(request: RejectTicketRequest, runtime: $RuntimeOptions): RejectTicketResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.comment)) {
    query['Comment'] = request.comment;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ticketId)) {
    query['TicketId'] = request.ticketId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RejectTicket',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RejectTicketRequest
 * @return RejectTicketResponse
 */
async function rejectTicket(request: RejectTicketRequest): RejectTicketResponse {
  var runtime = new $RuntimeOptions{};
  return rejectTicketWithOptions(request, runtime);
}

model ReleaseCallRequest {
  channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-6538214103685****'),
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-6538214103685****'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model ReleaseCallResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-653821410368****'),
          channelState?: string(name='ChannelState', example='CREATED'),
          channelVariables?: string(name='ChannelVariables'),
          destination?: string(name='Destination', example='1390501****'),
          jobId?: string(name='JobId', example='job-6538214103685****'),
          originator?: string(name='Originator', example='0830019****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          timestamp?: long(name='Timestamp', example='1609138903315'),
          userExtension?: string(name='UserExtension', example='8032****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    contextId?: long(name='ContextId', example='123456'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8032****'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='BREAK'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ReleaseCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleaseCallResponseBody(name='body'),
}

/**
 * @param request ReleaseCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleaseCallResponse
 */
async function releaseCallWithOptions(request: ReleaseCallRequest, runtime: $RuntimeOptions): ReleaseCallResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.channelId)) {
    query['ChannelId'] = request.channelId;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ReleaseCall',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ReleaseCallRequest
 * @return ReleaseCallResponse
 */
async function releaseCall(request: ReleaseCallRequest): ReleaseCallResponse {
  var runtime = new $RuntimeOptions{};
  return releaseCallWithOptions(request, runtime);
}

model ReleaseChatRequest {
  instanceId?: string(name='InstanceId', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='chat-6538214103685****'),
  token?: string(name='Token', example='9XYGTGWtq2wFi_Bpg7aUnIoYi_vG_rO3bjEn0YtsxbHRHrYHlz1LDBLJAyZcLxieRQR4h_6AnWvTjJeNU5jg************Hwej7WgWrmA='),
  userId?: string(name='UserId', example='edbcf95a-ef9f-4296-a0a6-985ac9e36db3'),
  userType?: string(name='UserType', description='This parameter is required.', example='CUSTOMER'),
}

model ReleaseChatResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='B06B3244-1B44-481B-90C4-F2F92E59D6B5'),
}

model ReleaseChatResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleaseChatResponseBody(name='body'),
}

/**
 * @param request ReleaseChatRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleaseChatResponse
 */
async function releaseChatWithOptions(request: ReleaseChatRequest, runtime: $RuntimeOptions): ReleaseChatResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.token)) {
    query['Token'] = request.token;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  if (!$isNull(request.userType)) {
    query['UserType'] = request.userType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ReleaseChat',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ReleaseChatRequest
 * @return ReleaseChatResponse
 */
async function releaseChat(request: ReleaseChatRequest): ReleaseChatResponse {
  var runtime = new $RuntimeOptions{};
  return releaseChatWithOptions(request, runtime);
}

model RemoveBlacklistCallTaggingRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', example='job-6538214103685****'),
  number?: string(name='Number', description='This parameter is required.', example='1312121****'),
}

model RemoveBlacklistCallTaggingResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', description='Id of the request', example='03C67DAD-EB26-41D8-949D-9B0C470FB716'),
}

model RemoveBlacklistCallTaggingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveBlacklistCallTaggingResponseBody(name='body'),
}

/**
 * @summary 编辑呼入控制号码
 *
 * @param request RemoveBlacklistCallTaggingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveBlacklistCallTaggingResponse
 */
async function removeBlacklistCallTaggingWithOptions(request: RemoveBlacklistCallTaggingRequest, runtime: $RuntimeOptions): RemoveBlacklistCallTaggingResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.number)) {
    query['Number'] = request.number;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveBlacklistCallTagging',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 编辑呼入控制号码
 *
 * @param request RemoveBlacklistCallTaggingRequest
 * @return RemoveBlacklistCallTaggingResponse
 */
async function removeBlacklistCallTagging(request: RemoveBlacklistCallTaggingRequest): RemoveBlacklistCallTaggingResponse {
  var runtime = new $RuntimeOptions{};
  return removeBlacklistCallTaggingWithOptions(request, runtime);
}

model RemoveDoNotCallNumbersRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  numberList?: string(name='NumberList', example='["1900000****","1312211****"]'),
}

model RemoveDoNotCallNumbersResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model RemoveDoNotCallNumbersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveDoNotCallNumbersResponseBody(name='body'),
}

/**
 * @summary 删除黑名单号码
 *
 * @param request RemoveDoNotCallNumbersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveDoNotCallNumbersResponse
 */
async function removeDoNotCallNumbersWithOptions(request: RemoveDoNotCallNumbersRequest, runtime: $RuntimeOptions): RemoveDoNotCallNumbersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.numberList)) {
    query['NumberList'] = request.numberList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveDoNotCallNumbers',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除黑名单号码
 *
 * @param request RemoveDoNotCallNumbersRequest
 * @return RemoveDoNotCallNumbersResponse
 */
async function removeDoNotCallNumbers(request: RemoveDoNotCallNumbersRequest): RemoveDoNotCallNumbersResponse {
  var runtime = new $RuntimeOptions{};
  return removeDoNotCallNumbersWithOptions(request, runtime);
}

model RemovePersonalNumbersFromUserRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  numberList?: string(name='NumberList', description='This parameter is required.', example='["0101234****", "0105678****"]'),
  userId?: string(name='UserId', description='This parameter is required.', example='agent@ccc-test'),
}

model RemovePersonalNumbersFromUserResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model RemovePersonalNumbersFromUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemovePersonalNumbersFromUserResponseBody(name='body'),
}

/**
 * @param request RemovePersonalNumbersFromUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemovePersonalNumbersFromUserResponse
 */
async function removePersonalNumbersFromUserWithOptions(request: RemovePersonalNumbersFromUserRequest, runtime: $RuntimeOptions): RemovePersonalNumbersFromUserResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.numberList)) {
    query['NumberList'] = request.numberList;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemovePersonalNumbersFromUser',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RemovePersonalNumbersFromUserRequest
 * @return RemovePersonalNumbersFromUserResponse
 */
async function removePersonalNumbersFromUser(request: RemovePersonalNumbersFromUserRequest): RemovePersonalNumbersFromUserResponse {
  var runtime = new $RuntimeOptions{};
  return removePersonalNumbersFromUserWithOptions(request, runtime);
}

model RemovePhoneNumberFromSkillGroupsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  number?: string(name='Number', description='This parameter is required.', example='0101234****'),
  skillGroupIdList?: string(name='SkillGroupIdList', description='This parameter is required.', example='["skillgroup1@ccc-test","skillgroup2@ccc-test"]'),
}

model RemovePhoneNumberFromSkillGroupsResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model RemovePhoneNumberFromSkillGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemovePhoneNumberFromSkillGroupsResponseBody(name='body'),
}

/**
 * @param request RemovePhoneNumberFromSkillGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemovePhoneNumberFromSkillGroupsResponse
 */
async function removePhoneNumberFromSkillGroupsWithOptions(request: RemovePhoneNumberFromSkillGroupsRequest, runtime: $RuntimeOptions): RemovePhoneNumberFromSkillGroupsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.number)) {
    query['Number'] = request.number;
  }
  if (!$isNull(request.skillGroupIdList)) {
    query['SkillGroupIdList'] = request.skillGroupIdList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemovePhoneNumberFromSkillGroups',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RemovePhoneNumberFromSkillGroupsRequest
 * @return RemovePhoneNumberFromSkillGroupsResponse
 */
async function removePhoneNumberFromSkillGroups(request: RemovePhoneNumberFromSkillGroupsRequest): RemovePhoneNumberFromSkillGroupsResponse {
  var runtime = new $RuntimeOptions{};
  return removePhoneNumberFromSkillGroupsWithOptions(request, runtime);
}

model RemovePhoneNumbersRequest {
  force?: boolean(name='Force', example='true'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  numberList?: string(name='NumberList', description='This parameter is required.', example='["0101234****","0105678****"]'),
}

model RemovePhoneNumbersResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ string ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model RemovePhoneNumbersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemovePhoneNumbersResponseBody(name='body'),
}

/**
 * @param request RemovePhoneNumbersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemovePhoneNumbersResponse
 */
async function removePhoneNumbersWithOptions(request: RemovePhoneNumbersRequest, runtime: $RuntimeOptions): RemovePhoneNumbersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.force)) {
    query['Force'] = request.force;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.numberList)) {
    query['NumberList'] = request.numberList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemovePhoneNumbers',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RemovePhoneNumbersRequest
 * @return RemovePhoneNumbersResponse
 */
async function removePhoneNumbers(request: RemovePhoneNumbersRequest): RemovePhoneNumbersResponse {
  var runtime = new $RuntimeOptions{};
  return removePhoneNumbersWithOptions(request, runtime);
}

model RemovePhoneNumbersFromSkillGroupRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  numberList?: string(name='NumberList', description='This parameter is required.', example='["0101234****","0105678****"]'),
  skillGroupId?: string(name='SkillGroupId', description='This parameter is required.', example='skillgroup@ccc-test'),
}

model RemovePhoneNumbersFromSkillGroupResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model RemovePhoneNumbersFromSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemovePhoneNumbersFromSkillGroupResponseBody(name='body'),
}

/**
 * @param request RemovePhoneNumbersFromSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemovePhoneNumbersFromSkillGroupResponse
 */
async function removePhoneNumbersFromSkillGroupWithOptions(request: RemovePhoneNumbersFromSkillGroupRequest, runtime: $RuntimeOptions): RemovePhoneNumbersFromSkillGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.numberList)) {
    query['NumberList'] = request.numberList;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemovePhoneNumbersFromSkillGroup',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RemovePhoneNumbersFromSkillGroupRequest
 * @return RemovePhoneNumbersFromSkillGroupResponse
 */
async function removePhoneNumbersFromSkillGroup(request: RemovePhoneNumbersFromSkillGroupRequest): RemovePhoneNumbersFromSkillGroupResponse {
  var runtime = new $RuntimeOptions{};
  return removePhoneNumbersFromSkillGroupWithOptions(request, runtime);
}

model RemoveSkillGroupsFromUserRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  skillGroupIdList?: string(name='SkillGroupIdList', description='This parameter is required.', example='["skillgroup1@ccc-test","skillgroup2@ccc-test"]'),
  userId?: string(name='UserId', description='This parameter is required.', example='agent@ccc-test'),
}

model RemoveSkillGroupsFromUserResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model RemoveSkillGroupsFromUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveSkillGroupsFromUserResponseBody(name='body'),
}

/**
 * @param request RemoveSkillGroupsFromUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveSkillGroupsFromUserResponse
 */
async function removeSkillGroupsFromUserWithOptions(request: RemoveSkillGroupsFromUserRequest, runtime: $RuntimeOptions): RemoveSkillGroupsFromUserResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.skillGroupIdList)) {
    query['SkillGroupIdList'] = request.skillGroupIdList;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveSkillGroupsFromUser',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RemoveSkillGroupsFromUserRequest
 * @return RemoveSkillGroupsFromUserResponse
 */
async function removeSkillGroupsFromUser(request: RemoveSkillGroupsFromUserRequest): RemoveSkillGroupsFromUserResponse {
  var runtime = new $RuntimeOptions{};
  return removeSkillGroupsFromUserWithOptions(request, runtime);
}

model RemoveUsersRequest {
  filePath?: string(name='FilePath'),
  force?: boolean(name='Force'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  notificationEmail?: string(name='NotificationEmail'),
  userIdList?: string(name='UserIdList', example='["agent1@ccc-test","agent2@ccc-test"]'),
}

model RemoveUsersResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model RemoveUsersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveUsersResponseBody(name='body'),
}

/**
 * @param request RemoveUsersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveUsersResponse
 */
async function removeUsersWithOptions(request: RemoveUsersRequest, runtime: $RuntimeOptions): RemoveUsersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.filePath)) {
    query['FilePath'] = request.filePath;
  }
  if (!$isNull(request.force)) {
    query['Force'] = request.force;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.notificationEmail)) {
    query['NotificationEmail'] = request.notificationEmail;
  }
  if (!$isNull(request.userIdList)) {
    query['UserIdList'] = request.userIdList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveUsers',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RemoveUsersRequest
 * @return RemoveUsersResponse
 */
async function removeUsers(request: RemoveUsersRequest): RemoveUsersResponse {
  var runtime = new $RuntimeOptions{};
  return removeUsersWithOptions(request, runtime);
}

model RemoveUsersFromSkillGroupRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  skillGroupId?: string(name='SkillGroupId', description='This parameter is required.', example='skillgroup@ccc-test'),
  userIdList?: string(name='UserIdList', description='This parameter is required.', example='["agent1@ccc-test","agent2@ccc-test"]'),
}

model RemoveUsersFromSkillGroupResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model RemoveUsersFromSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveUsersFromSkillGroupResponseBody(name='body'),
}

/**
 * @param request RemoveUsersFromSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveUsersFromSkillGroupResponse
 */
async function removeUsersFromSkillGroupWithOptions(request: RemoveUsersFromSkillGroupRequest, runtime: $RuntimeOptions): RemoveUsersFromSkillGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  if (!$isNull(request.userIdList)) {
    query['UserIdList'] = request.userIdList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveUsersFromSkillGroup',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RemoveUsersFromSkillGroupRequest
 * @return RemoveUsersFromSkillGroupResponse
 */
async function removeUsersFromSkillGroup(request: RemoveUsersFromSkillGroupRequest): RemoveUsersFromSkillGroupResponse {
  var runtime = new $RuntimeOptions{};
  return removeUsersFromSkillGroupWithOptions(request, runtime);
}

model ResetAgentStateRequest {
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model ResetAgentStateResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    breakCode?: string(name='BreakCode', example='Warm-up'),
    deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
    extension?: string(name='Extension', example='8001****'),
    instanceId?: string(name='InstanceId', example='ccc-test'),
    jobId?: string(name='JobId'),
    outboundScenario?: boolean(name='OutboundScenario', example='false'),
    signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
    userId?: string(name='UserId', example='agent@ccc-test'),
    userState?: string(name='UserState', example='OFFLINE'),
    workMode?: string(name='WorkMode', example='ON_SITE'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model ResetAgentStateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetAgentStateResponseBody(name='body'),
}

/**
 * @param request ResetAgentStateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResetAgentStateResponse
 */
async function resetAgentStateWithOptions(request: ResetAgentStateRequest, runtime: $RuntimeOptions): ResetAgentStateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ResetAgentState',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ResetAgentStateRequest
 * @return ResetAgentStateResponse
 */
async function resetAgentState(request: ResetAgentStateRequest): ResetAgentStateResponse {
  var runtime = new $RuntimeOptions{};
  return resetAgentStateWithOptions(request, runtime);
}

model ResetUserPasswordRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  password?: string(name='Password', description='This parameter is required.', example='password'),
  userId?: string(name='UserId', description='This parameter is required.', example='agent@ccc-test'),
}

model ResetUserPasswordResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model ResetUserPasswordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetUserPasswordResponseBody(name='body'),
}

/**
 * @param request ResetUserPasswordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResetUserPasswordResponse
 */
async function resetUserPasswordWithOptions(request: ResetUserPasswordRequest, runtime: $RuntimeOptions): ResetUserPasswordResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.password)) {
    query['Password'] = request.password;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ResetUserPassword',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ResetUserPasswordRequest
 * @return ResetUserPasswordResponse
 */
async function resetUserPassword(request: ResetUserPasswordRequest): ResetUserPasswordResponse {
  var runtime = new $RuntimeOptions{};
  return resetUserPasswordWithOptions(request, runtime);
}

model RestoreArchivedRecordingsRequest {
  contactIds?: string(name='ContactIds', example='[\\\\"job-216750038017142784\\\\"]'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model RestoreArchivedRecordingsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      contactId?: string(name='ContactId', example='job-25920271311543****'),
      exists?: string(name='Exists', example='False'),
      status?: string(name='Status', example='Progressing'),
      storageType?: string(name='StorageType', example='Standard'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='Instance 0 does not exist.'),
  requestId?: string(name='RequestId', example='F8066648-5D95-55AB-ACD3-2F4AD3BEA715'),
}

model RestoreArchivedRecordingsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RestoreArchivedRecordingsResponseBody(name='body'),
}

/**
 * @summary 录音解冻
 *
 * @param request RestoreArchivedRecordingsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RestoreArchivedRecordingsResponse
 */
async function restoreArchivedRecordingsWithOptions(request: RestoreArchivedRecordingsRequest, runtime: $RuntimeOptions): RestoreArchivedRecordingsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactIds)) {
    query['ContactIds'] = request.contactIds;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RestoreArchivedRecordings',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 录音解冻
 *
 * @param request RestoreArchivedRecordingsRequest
 * @return RestoreArchivedRecordingsResponse
 */
async function restoreArchivedRecordings(request: RestoreArchivedRecordingsRequest): RestoreArchivedRecordingsResponse {
  var runtime = new $RuntimeOptions{};
  return restoreArchivedRecordingsWithOptions(request, runtime);
}

model ResubmitTicketRequest {
  comment?: string(name='Comment'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  ticketId?: string(name='TicketId', description='This parameter is required.', example='f2c6722b-cd13-442d-bf10-22a07c70d6d5'),
}

model ResubmitTicketResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: any(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='03C67DAD-EB26-41D8-949D-9B0C470FB716'),
}

model ResubmitTicketResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResubmitTicketResponseBody(name='body'),
}

/**
 * @param request ResubmitTicketRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResubmitTicketResponse
 */
async function resubmitTicketWithOptions(request: ResubmitTicketRequest, runtime: $RuntimeOptions): ResubmitTicketResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.comment)) {
    query['Comment'] = request.comment;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ticketId)) {
    query['TicketId'] = request.ticketId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ResubmitTicket',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ResubmitTicketRequest
 * @return ResubmitTicketResponse
 */
async function resubmitTicket(request: ResubmitTicketRequest): ResubmitTicketResponse {
  var runtime = new $RuntimeOptions{};
  return resubmitTicketWithOptions(request, runtime);
}

model ResumeCampaignRequest {
  campaignId?: string(name='CampaignId', description='This parameter is required.', example='6badb397-a8b5-40b6-21019d382a09'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model ResumeCampaignResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: string(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='F505C4C8-1E12-573A-9BA7-4BEAAD129553'),
}

model ResumeCampaignResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResumeCampaignResponseBody(name='body'),
}

/**
 * @summary 恢复预测式外呼活动
 *
 * @param request ResumeCampaignRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResumeCampaignResponse
 */
async function resumeCampaignWithOptions(request: ResumeCampaignRequest, runtime: $RuntimeOptions): ResumeCampaignResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.campaignId)) {
    query['CampaignId'] = request.campaignId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ResumeCampaign',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 恢复预测式外呼活动
 *
 * @param request ResumeCampaignRequest
 * @return ResumeCampaignResponse
 */
async function resumeCampaign(request: ResumeCampaignRequest): ResumeCampaignResponse {
  var runtime = new $RuntimeOptions{};
  return resumeCampaignWithOptions(request, runtime);
}

model RetrieveCallRequest {
  channelId?: string(name='ChannelId', description='This parameter is required.', example='ch:user:1390501****->8032****:1609138902226:job-6538214103685****'),
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-6538214103685****'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model RetrieveCallResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-653821410368****'),
          channelState?: string(name='ChannelState', example='CREATED'),
          destination?: string(name='Destination', example='1390501****'),
          jobId?: string(name='JobId', example='job-6538214103685****'),
          originator?: string(name='Originator', example='0830019****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
          timestamp?: long(name='Timestamp', example='1609138903315'),
          userExtension?: string(name='UserExtension', example='8032****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8032****'),
      heartbeat?: long(name='Heartbeat', example='1609136956378'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
      mobile?: string(name='Mobile', example='1324730****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1609136956378'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='BREAK'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model RetrieveCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RetrieveCallResponseBody(name='body'),
}

/**
 * @param request RetrieveCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RetrieveCallResponse
 */
async function retrieveCallWithOptions(request: RetrieveCallRequest, runtime: $RuntimeOptions): RetrieveCallResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.channelId)) {
    query['ChannelId'] = request.channelId;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RetrieveCall',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RetrieveCallRequest
 * @return RetrieveCallResponse
 */
async function retrieveCall(request: RetrieveCallRequest): RetrieveCallResponse {
  var runtime = new $RuntimeOptions{};
  return retrieveCallWithOptions(request, runtime);
}

model SaveDocumentRequest {
  documentId?: string(name='DocumentId', example='xxx'),
  documentJson?: string(name='DocumentJson', description='This parameter is required.', example='{"name":"tom"}'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='9cfad875-6260-4a53-ab6e-b13e3fb31f7d'),
  requestId?: string(name='RequestId', example='EAF3C248-E123-441B-A545-B6CD02E98EED'),
  schemaId?: string(name='SchemaId', description='schema id

This parameter is required.', example='profile'),
}

model SaveDocumentResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='0101234****'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='01B12EE4-6AF2-4730-8B78-EC15F4E5C025'),
}

model SaveDocumentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveDocumentResponseBody(name='body'),
}

/**
 * @param request SaveDocumentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SaveDocumentResponse
 */
async function saveDocumentWithOptions(request: SaveDocumentRequest, runtime: $RuntimeOptions): SaveDocumentResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.documentId)) {
    body['DocumentId'] = request.documentId;
  }
  if (!$isNull(request.documentJson)) {
    body['DocumentJson'] = request.documentJson;
  }
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  if (!$isNull(request.schemaId)) {
    body['SchemaId'] = request.schemaId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SaveDocument',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request SaveDocumentRequest
 * @return SaveDocumentResponse
 */
async function saveDocument(request: SaveDocumentRequest): SaveDocumentResponse {
  var runtime = new $RuntimeOptions{};
  return saveDocumentWithOptions(request, runtime);
}

model SaveRTCStatsV2Request {
  callId?: string(name='CallId', description='This parameter is required.', example='257e73de-1ee8-123b-0b9a-00163e0a****'),
  generalInfo?: string(name='GeneralInfo', description='This parameter is required.'),
  googAddress?: string(name='GoogAddress', description='This parameter is required.', example='["47.101.XX.XX","44368","47.104.XX.XX","37947"]'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  receiverReport?: string(name='ReceiverReport', description='This parameter is required.', example='["1","1649328987","40","PCMU","383560","89","49","ssrc_1649328987_recv","2022-03-15T09:52:08.820Z","","0","20000"]'),
  senderReport?: string(name='SenderReport', description='This parameter is required.', example='["11090","2055127460","0","2236","384592","ssrc_2055127460_send","2022-03-15T09:52:08.820Z","1"]'),
}

model SaveRTCStatsV2ResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
  rowCount?: long(name='RowCount', example='1'),
  success?: boolean(name='Success', example='true'),
  timeStamp?: long(name='TimeStamp', example='1647309061000'),
}

model SaveRTCStatsV2Response = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveRTCStatsV2ResponseBody(name='body'),
}

/**
 * @param request SaveRTCStatsV2Request
 * @param runtime runtime options for this request RuntimeOptions
 * @return SaveRTCStatsV2Response
 */
async function saveRTCStatsV2WithOptions(request: SaveRTCStatsV2Request, runtime: $RuntimeOptions): SaveRTCStatsV2Response {
  request.validate();
  var query = {};
  if (!$isNull(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!$isNull(request.generalInfo)) {
    query['GeneralInfo'] = request.generalInfo;
  }
  if (!$isNull(request.googAddress)) {
    query['GoogAddress'] = request.googAddress;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.receiverReport)) {
    query['ReceiverReport'] = request.receiverReport;
  }
  if (!$isNull(request.senderReport)) {
    query['SenderReport'] = request.senderReport;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SaveRTCStatsV2',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request SaveRTCStatsV2Request
 * @return SaveRTCStatsV2Response
 */
async function saveRTCStatsV2(request: SaveRTCStatsV2Request): SaveRTCStatsV2Response {
  var runtime = new $RuntimeOptions{};
  return saveRTCStatsV2WithOptions(request, runtime);
}

model SaveTerminalLogRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='CCCClient'),
  callId?: string(name='CallId', description='This parameter is required.', example='e13c9740-1e37-123b-21b6-00163e352f9'),
  content?: string(name='Content', description='This parameter is required.', example='none'),
  dataType?: int32(name='DataType', description='This parameter is required.', example='1'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-b8b0ca63-330c-4e65-8ae3-9de2c7ce7683'),
  methodName?: string(name='MethodName', example='TurnServerTest'),
  status?: string(name='Status', description='This parameter is required.', example='true'),
  uniqueRequestId?: string(name='UniqueRequestId', description='This parameter is required.', example='none'),
}

model SaveTerminalLogResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
  success?: boolean(name='Success', example='true'),
  timeStamp?: long(name='TimeStamp', example='1647309061000'),
}

model SaveTerminalLogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveTerminalLogResponseBody(name='body'),
}

/**
 * @param request SaveTerminalLogRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SaveTerminalLogResponse
 */
async function saveTerminalLogWithOptions(request: SaveTerminalLogRequest, runtime: $RuntimeOptions): SaveTerminalLogResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!$isNull(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!$isNull(request.content)) {
    query['Content'] = request.content;
  }
  if (!$isNull(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.methodName)) {
    query['MethodName'] = request.methodName;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  if (!$isNull(request.uniqueRequestId)) {
    query['UniqueRequestId'] = request.uniqueRequestId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SaveTerminalLog',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request SaveTerminalLogRequest
 * @return SaveTerminalLogResponse
 */
async function saveTerminalLog(request: SaveTerminalLogRequest): SaveTerminalLogResponse {
  var runtime = new $RuntimeOptions{};
  return saveTerminalLogWithOptions(request, runtime);
}

model SaveWebRTCStatsRequest {
  callId?: string(name='CallId', description='This parameter is required.', example='257e73de-1ee8-123b-0b9a-00163e0a****'),
  generalInfo?: string(name='GeneralInfo', description='This parameter is required.'),
  googAddress?: string(name='GoogAddress', description='This parameter is required.', example='["47.101.XX.XX","44368","47.104.XX.XX","37947"]'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  receiverReport?: string(name='ReceiverReport', description='This parameter is required.', example='["1","1649328987","40","PCMU","383560","89","49","ssrc_1649328987_recv","2022-03-15T09:52:08.820Z","","0","20000"]'),
  senderReport?: string(name='SenderReport', description='This parameter is required.', example='["11090","2055127460","0","2236","384592","ssrc_2055127460_send","2022-03-15T09:52:08.820Z","1"]'),
}

model SaveWebRTCStatsResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='CF1C21B9-2D49-4B54-880F-FBE248C16903'),
  rowCount?: long(name='RowCount', example='1'),
  success?: boolean(name='Success', example='true'),
  timeStamp?: long(name='TimeStamp', example='1555492246000'),
}

model SaveWebRTCStatsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveWebRTCStatsResponseBody(name='body'),
}

/**
 * @param request SaveWebRTCStatsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SaveWebRTCStatsResponse
 */
async function saveWebRTCStatsWithOptions(request: SaveWebRTCStatsRequest, runtime: $RuntimeOptions): SaveWebRTCStatsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!$isNull(request.generalInfo)) {
    query['GeneralInfo'] = request.generalInfo;
  }
  if (!$isNull(request.googAddress)) {
    query['GoogAddress'] = request.googAddress;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.receiverReport)) {
    query['ReceiverReport'] = request.receiverReport;
  }
  if (!$isNull(request.senderReport)) {
    query['SenderReport'] = request.senderReport;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SaveWebRTCStats',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request SaveWebRTCStatsRequest
 * @return SaveWebRTCStatsResponse
 */
async function saveWebRTCStats(request: SaveWebRTCStatsRequest): SaveWebRTCStatsResponse {
  var runtime = new $RuntimeOptions{};
  return saveWebRTCStatsWithOptions(request, runtime);
}

model SaveWebRtcInfoRequest {
  callId?: string(name='CallId', description='This parameter is required.', example='e13c9740-1e37-123b-21b6-00163e352f9'),
  content?: string(name='Content', description='This parameter is required.', example='{"media_source":{},"remote_inbound_rtp":{},"outbound_rtp":{},"inbound_rtp":{},"remote_outbound_rtp":{},"candidate":{},"basic":{"callId":"e13c9740-1e37-123b-21b6-00163e352f9","timestamp":"1647262108395","callStartTime":"1647262108393","uid":"user-test","access_point":"shanghai","browser":"90","ip":"127.0.0.1"}}'),
  contentType?: string(name='ContentType', description='This parameter is required.', example='4'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-b8b0ca63-330c-4e65-8ae3-9de2c7ce7683'),
}

model SaveWebRtcInfoResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='CF1C21B9-2D49-4B54-880F-FBE248C16903'),
  rowCount?: long(name='RowCount', example='1'),
  success?: boolean(name='Success', example='true'),
  timeStamp?: long(name='TimeStamp', example='1647262108395'),
}

model SaveWebRtcInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveWebRtcInfoResponseBody(name='body'),
}

/**
 * @param request SaveWebRtcInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SaveWebRtcInfoResponse
 */
async function saveWebRtcInfoWithOptions(request: SaveWebRtcInfoRequest, runtime: $RuntimeOptions): SaveWebRtcInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!$isNull(request.content)) {
    query['Content'] = request.content;
  }
  if (!$isNull(request.contentType)) {
    query['ContentType'] = request.contentType;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SaveWebRtcInfo',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request SaveWebRtcInfoRequest
 * @return SaveWebRtcInfoResponse
 */
async function saveWebRtcInfo(request: SaveWebRtcInfoRequest): SaveWebRtcInfoResponse {
  var runtime = new $RuntimeOptions{};
  return saveWebRtcInfoWithOptions(request, runtime);
}

model SendDtmfSignalingRequest {
  channelId?: string(name='ChannelId', description='This parameter is required.', example='ch:customer:0108989****->1318888****:1609234221870:job-6573574060089****'),
  deviceId?: string(name='DeviceId', example='device'),
  dtmf?: string(name='Dtmf', description='This parameter is required.', example='5'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-6573574060089****'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model SendDtmfSignalingResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelFlags?: string(name='ChannelFlags', example='MONITORING'),
          channelId?: string(name='ChannelId', example='ch:user:131888****->8001****:1609234221870:job-6573574060089****'),
          channelState?: string(name='ChannelState', example='ANSWERED'),
          destination?: string(name='Destination', example='8001****'),
          index?: int32(name='Index', example='1'),
          jobId?: string(name='JobId', example='job-6573574060089****'),
          originator?: string(name='Originator', example='0101234****'),
          releaseInitiator?: string(name='ReleaseInitiator'),
          releaseReason?: string(name='ReleaseReason'),
          skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
          timestamp?: long(name='Timestamp', example='1609234222367'),
          userExtension?: string(name='UserExtension', example='8001****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6573574060089****'),
    }(name='CallContext'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8001****'),
      heartbeat?: long(name='Heartbeat', example='1609234222375'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6573574060089****'),
      mobile?: string(name='Mobile', example='1390000****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1609234221864'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='842399EC-7D32-4472-AD08-9504C3F141FF'),
}

model SendDtmfSignalingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SendDtmfSignalingResponseBody(name='body'),
}

/**
 * @param request SendDtmfSignalingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SendDtmfSignalingResponse
 */
async function sendDtmfSignalingWithOptions(request: SendDtmfSignalingRequest, runtime: $RuntimeOptions): SendDtmfSignalingResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.channelId)) {
    query['ChannelId'] = request.channelId;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.dtmf)) {
    query['Dtmf'] = request.dtmf;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SendDtmfSignaling',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request SendDtmfSignalingRequest
 * @return SendDtmfSignalingResponse
 */
async function sendDtmfSignaling(request: SendDtmfSignalingRequest): SendDtmfSignalingResponse {
  var runtime = new $RuntimeOptions{};
  return sendDtmfSignalingWithOptions(request, runtime);
}

model SignInGroupRequest {
  additivity?: boolean(name='Additivity'),
  chatDeviceId?: string(name='ChatDeviceId'),
  deviceId?: string(name='DeviceId', description='This parameter is required.', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  signedSkillGroupIdList?: string(name='SignedSkillGroupIdList', description='This parameter is required.', example='["skillgroup1@ccc-test","skillgroup2@ccc-test"]'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model SignInGroupResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    breakCode?: string(name='BreakCode', example='Warm-up'),
    chatDeviceId?: string(name='ChatDeviceId'),
    deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
    extension?: string(name='Extension', example='8032****'),
    instanceId?: string(name='InstanceId', example='ccc-test'),
    jobId?: string(name='JobId'),
    outboundScenario?: boolean(name='OutboundScenario', example='false'),
    signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
    userId?: string(name='UserId', example='agent@ccc-test'),
    userState?: string(name='UserState', example='READY'),
    workMode?: string(name='WorkMode', example='ON_SITE'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model SignInGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SignInGroupResponseBody(name='body'),
}

/**
 * @param request SignInGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SignInGroupResponse
 */
async function signInGroupWithOptions(request: SignInGroupRequest, runtime: $RuntimeOptions): SignInGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.additivity)) {
    query['Additivity'] = request.additivity;
  }
  if (!$isNull(request.chatDeviceId)) {
    query['ChatDeviceId'] = request.chatDeviceId;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.signedSkillGroupIdList)) {
    query['SignedSkillGroupIdList'] = request.signedSkillGroupIdList;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SignInGroup',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request SignInGroupRequest
 * @return SignInGroupResponse
 */
async function signInGroup(request: SignInGroupRequest): SignInGroupResponse {
  var runtime = new $RuntimeOptions{};
  return signInGroupWithOptions(request, runtime);
}

model SignOutGroupRequest {
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model SignOutGroupResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    breakCode?: string(name='BreakCode', example='Warm-up'),
    deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
    extension?: string(name='Extension', example='8032****'),
    heartbeat?: long(name='Heartbeat', example='1609136956378'),
    instanceId?: string(name='InstanceId', example='ccc-test'),
    jobId?: string(name='JobId', example='job-6538214103685****'),
    mobile?: string(name='Mobile', example='1324730****'),
    outboundScenario?: boolean(name='OutboundScenario', example='false'),
    reserved?: long(name='Reserved', example='1609136956378'),
    signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
    userId?: string(name='UserId', example='agent@ccc-test'),
    userState?: string(name='UserState', example='BREAK'),
    workMode?: string(name='WorkMode', example='ON_SITE'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model SignOutGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SignOutGroupResponseBody(name='body'),
}

/**
 * @param request SignOutGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SignOutGroupResponse
 */
async function signOutGroupWithOptions(request: SignOutGroupRequest, runtime: $RuntimeOptions): SignOutGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SignOutGroup',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request SignOutGroupRequest
 * @return SignOutGroupResponse
 */
async function signOutGroup(request: SignOutGroupRequest): SignOutGroupResponse {
  var runtime = new $RuntimeOptions{};
  return signOutGroupWithOptions(request, runtime);
}

model StartBack2BackCallRequest {
  additionalBroker?: string(name='AdditionalBroker', example='0102156****'),
  broker?: string(name='Broker', description='This parameter is required.', example='0102157****'),
  callee?: string(name='Callee', description='This parameter is required.', example='1372168****'),
  caller?: string(name='Caller', description='This parameter is required.', example='1391814****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  tags?: string(name='Tags'),
  timeoutSeconds?: int32(name='TimeoutSeconds', example='30'),
}

model StartBack2BackCallResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='BACK2BACK'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='BACK2BACK'),
          channelFlags?: string(name='ChannelFlags', example='MONITORING'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-653821410368****'),
          channelState?: string(name='ChannelState', example='NONE'),
          destination?: string(name='Destination', example='1372168****'),
          jobId?: string(name='JobId', example='job-1034159089076****'),
          originator?: string(name='Originator', example='0102157****'),
          releaseInitiator?: string(name='ReleaseInitiator'),
          releaseReason?: string(name='ReleaseReason'),
          timestamp?: long(name='Timestamp', example='1618217874062'),
          userExtension?: string(name='UserExtension', example='8001****'),
          userId?: string(name='UserId'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-1034159089076****'),
    }(name='CallContext'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      deviceState?: string(name='DeviceState'),
      extension?: string(name='Extension', example='8020****'),
      heartbeat?: long(name='Heartbeat', example='1618217872911'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-1034159089076****'),
      mobile?: string(name='Mobile', example='1324730****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1618217794599'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='OFFLINE'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='26A34338-5CD9-4C95-A7A6-5BDCE76C6B94'),
}

model StartBack2BackCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartBack2BackCallResponseBody(name='body'),
}

/**
 * @param request StartBack2BackCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartBack2BackCallResponse
 */
async function startBack2BackCallWithOptions(request: StartBack2BackCallRequest, runtime: $RuntimeOptions): StartBack2BackCallResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.additionalBroker)) {
    query['AdditionalBroker'] = request.additionalBroker;
  }
  if (!$isNull(request.broker)) {
    query['Broker'] = request.broker;
  }
  if (!$isNull(request.callee)) {
    query['Callee'] = request.callee;
  }
  if (!$isNull(request.caller)) {
    query['Caller'] = request.caller;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!$isNull(request.timeoutSeconds)) {
    query['TimeoutSeconds'] = request.timeoutSeconds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartBack2BackCall',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request StartBack2BackCallRequest
 * @return StartBack2BackCallResponse
 */
async function startBack2BackCall(request: StartBack2BackCallRequest): StartBack2BackCallResponse {
  var runtime = new $RuntimeOptions{};
  return startBack2BackCallWithOptions(request, runtime);
}

model StartChatRequest {
  accessChannelId?: string(name='AccessChannelId', example='cf584733-***-***-9699-cb77aa3b7aa6'),
  instanceId?: string(name='InstanceId', example='ccc-test'),
  token?: string(name='Token', example='9XYGTGWtq2wFi_Bpg7aUnIoYi_vG_rO3bjEn0YtsxbHRHrYHlz1LDBLJAyZcLxieRQR4h_6AnWvTjJeNU5jg************Hwej7WgWrmA='),
  userList?: [ 
    {
      avatarUrl?: string(name='AvatarUrl', example='http://xxx.com/image'),
      nickname?: string(name='Nickname'),
      userId?: string(name='UserId', example='fcd020fe-d8e4-40e5-8c77-1a272a174a7d'),
      userType?: string(name='UserType', example='CUSTOMER'),
    }
  ](name='UserList', description='This parameter is required.'),
}

model StartChatShrinkRequest {
  accessChannelId?: string(name='AccessChannelId', example='cf584733-***-***-9699-cb77aa3b7aa6'),
  instanceId?: string(name='InstanceId', example='ccc-test'),
  token?: string(name='Token', example='9XYGTGWtq2wFi_Bpg7aUnIoYi_vG_rO3bjEn0YtsxbHRHrYHlz1LDBLJAyZcLxieRQR4h_6AnWvTjJeNU5jg************Hwej7WgWrmA='),
  userListShrink?: string(name='UserList', description='This parameter is required.'),
}

model StartChatResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    chatConversationId?: string(name='ChatConversationId', example='$23086709$EAUNIT'),
    jobId?: string(name='JobId', example='chat-525523618219921408'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model StartChatResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartChatResponseBody(name='body'),
}

/**
 * @param tmpReq StartChatRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartChatResponse
 */
async function startChatWithOptions(tmpReq: StartChatRequest, runtime: $RuntimeOptions): StartChatResponse {
  tmpReq.validate();
  var request = new StartChatShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.userList)) {
    request.userListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.userList, 'UserList', 'json');
  }
  var query = {};
  if (!$isNull(request.accessChannelId)) {
    query['AccessChannelId'] = request.accessChannelId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.token)) {
    query['Token'] = request.token;
  }
  if (!$isNull(request.userListShrink)) {
    query['UserList'] = request.userListShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartChat',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request StartChatRequest
 * @return StartChatResponse
 */
async function startChat(request: StartChatRequest): StartChatResponse {
  var runtime = new $RuntimeOptions{};
  return startChatWithOptions(request, runtime);
}

model StartConferenceRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  participantListJson?: string(name='ParticipantListJson', description='This parameter is required.', example='["8045****","1317511****"]'),
  tags?: string(name='Tags'),
  timeoutSeconds?: int32(name='TimeoutSeconds', example='30'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model StartConferenceResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelFlags?: string(name='ChannelFlags', example='MONITORING'),
          channelId?: string(name='ChannelId', example='ch:user:131888****->8001****:1609225718294:job-65700074013925376'),
          channelState?: string(name='ChannelState', example='ANSWERED'),
          destination?: string(name='Destination', example='8001****'),
          jobId?: string(name='JobId', example='job-6573574060089****'),
          originator?: string(name='Originator', example='1318888****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          timestamp?: long(name='Timestamp', example='1609138903315'),
          userExtension?: string(name='UserExtension', example='8032****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      deviceState?: string(name='DeviceState', example='false'),
      extension?: string(name='Extension', example='8032****'),
      heartbeat?: long(name='Heartbeat', example='1609136956378'),
      instanceId?: string(name='InstanceId', example='1609136956378'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
      mobile?: string(name='Mobile', example='1324730****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1609136956378'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='FDD327D1-AB8A-596B-883F-F63582A73F1D'),
}

model StartConferenceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartConferenceResponseBody(name='body'),
}

/**
 * @param request StartConferenceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartConferenceResponse
 */
async function startConferenceWithOptions(request: StartConferenceRequest, runtime: $RuntimeOptions): StartConferenceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.participantListJson)) {
    query['ParticipantListJson'] = request.participantListJson;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!$isNull(request.timeoutSeconds)) {
    query['TimeoutSeconds'] = request.timeoutSeconds;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartConference',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request StartConferenceRequest
 * @return StartConferenceResponse
 */
async function startConference(request: StartConferenceRequest): StartConferenceResponse {
  var runtime = new $RuntimeOptions{};
  return startConferenceWithOptions(request, runtime);
}

model StartEditContactFlowRequest {
  contactFlowId?: string(name='ContactFlowId', description='This parameter is required.', example='798e83a9-5140-4039-afa1-761ca4cca2df'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model StartEditContactFlowResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='b3114362-9062-46c7-82dc-ae55ac168b2e'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BC2733CE-C470-564A-8C11-9DC02468823A'),
}

model StartEditContactFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartEditContactFlowResponseBody(name='body'),
}

/**
 * @param request StartEditContactFlowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartEditContactFlowResponse
 */
async function startEditContactFlowWithOptions(request: StartEditContactFlowRequest, runtime: $RuntimeOptions): StartEditContactFlowResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.contactFlowId)) {
    query['ContactFlowId'] = request.contactFlowId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartEditContactFlow',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request StartEditContactFlowRequest
 * @return StartEditContactFlowResponse
 */
async function startEditContactFlow(request: StartEditContactFlowRequest): StartEditContactFlowResponse {
  var runtime = new $RuntimeOptions{};
  return startEditContactFlowWithOptions(request, runtime);
}

model StartPredictiveCallRequest {
  callee?: string(name='Callee', description='This parameter is required.', example='1312353****'),
  caller?: string(name='Caller', description='This parameter is required.', example='0109810****'),
  contactFlowId?: string(name='ContactFlowId', description='This parameter is required.', example='9774c36c-12fe-4e37-adce-89bc77ce****'),
  contactFlowVariables?: string(name='ContactFlowVariables'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  maskedCallee?: string(name='MaskedCallee', example='1312353****'),
  skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
  tags?: string(name='Tags'),
  timeoutSeconds?: int32(name='TimeoutSeconds', example='10'),
}

model StartPredictiveCallResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelFlags?: string(name='ChannelFlags', example='[]'),
          channelId?: string(name='ChannelId', example='ch:user:131888****->8001****:1609225718294:job-6570007401392****'),
          channelState?: string(name='ChannelState', example='NONE'),
          destination?: string(name='Destination', example='8001****'),
          jobId?: string(name='JobId', example='job-6570007401392****'),
          originator?: string(name='Originator', example='1318888****'),
          releaseInitiator?: string(name='ReleaseInitiator'),
          releaseReason?: string(name='ReleaseReason'),
          timestamp?: long(name='Timestamp', example='1609225718295'),
          userExtension?: string(name='UserExtension', example='8001****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6570007401392****'),
    }(name='CallContext'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      deviceState?: string(name='DeviceState', example='ONLINE'),
      extension?: string(name='Extension', example='8001****'),
      heartbeat?: long(name='Heartbeat', example='1609136956378'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6570007401392****'),
      mobile?: string(name='Mobile', example='1324730****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      reserved?: long(name='Reserved', example='1609136956378'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='READY'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='26A34338-5CD9-4C95-A7A6-5BDCE76C6B94'),
}

model StartPredictiveCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartPredictiveCallResponseBody(name='body'),
}

/**
 * @param request StartPredictiveCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartPredictiveCallResponse
 */
async function startPredictiveCallWithOptions(request: StartPredictiveCallRequest, runtime: $RuntimeOptions): StartPredictiveCallResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.callee)) {
    query['Callee'] = request.callee;
  }
  if (!$isNull(request.caller)) {
    query['Caller'] = request.caller;
  }
  if (!$isNull(request.contactFlowId)) {
    query['ContactFlowId'] = request.contactFlowId;
  }
  if (!$isNull(request.contactFlowVariables)) {
    query['ContactFlowVariables'] = request.contactFlowVariables;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.maskedCallee)) {
    query['MaskedCallee'] = request.maskedCallee;
  }
  if (!$isNull(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!$isNull(request.timeoutSeconds)) {
    query['TimeoutSeconds'] = request.timeoutSeconds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartPredictiveCall',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request StartPredictiveCallRequest
 * @return StartPredictiveCallResponse
 */
async function startPredictiveCall(request: StartPredictiveCallRequest): StartPredictiveCallResponse {
  var runtime = new $RuntimeOptions{};
  return startPredictiveCallWithOptions(request, runtime);
}

model StartPrivacyCallRequest {
  appId?: string(name='AppId', description='This parameter is required.', example='ALIPUBB7A727C170949'),
  callee?: string(name='Callee', description='This parameter is required.', example='1888888****'),
  caller?: string(name='Caller', description='This parameter is required.', example='0109810****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model StartPrivacyCallResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='job-xxx'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='0630E5DF-CEB0-445B-8626-D5C7481181C3'),
}

model StartPrivacyCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartPrivacyCallResponseBody(name='body'),
}

/**
 * @summary 发起隐私呼叫
 *
 * @param request StartPrivacyCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartPrivacyCallResponse
 */
async function startPrivacyCallWithOptions(request: StartPrivacyCallRequest, runtime: $RuntimeOptions): StartPrivacyCallResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.callee)) {
    query['Callee'] = request.callee;
  }
  if (!$isNull(request.caller)) {
    query['Caller'] = request.caller;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartPrivacyCall',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 发起隐私呼叫
 *
 * @param request StartPrivacyCallRequest
 * @return StartPrivacyCallResponse
 */
async function startPrivacyCall(request: StartPrivacyCallRequest): StartPrivacyCallResponse {
  var runtime = new $RuntimeOptions{};
  return startPrivacyCallWithOptions(request, runtime);
}

model SubmitCampaignRequest {
  campaignId?: string(name='CampaignId', description='This parameter is required.', example='6badb397-a8b5-40b6-21019d382a09'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
}

model SubmitCampaignResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: string(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='7CC6523B-0E51-1B62-8DA5-6A9831CAE315'),
}

model SubmitCampaignResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitCampaignResponseBody(name='body'),
}

/**
 * @summary 提交预测式外呼活动
 *
 * @param request SubmitCampaignRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitCampaignResponse
 */
async function submitCampaignWithOptions(request: SubmitCampaignRequest, runtime: $RuntimeOptions): SubmitCampaignResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.campaignId)) {
    query['CampaignId'] = request.campaignId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitCampaign',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 提交预测式外呼活动
 *
 * @param request SubmitCampaignRequest
 * @return SubmitCampaignResponse
 */
async function submitCampaign(request: SubmitCampaignRequest): SubmitCampaignResponse {
  var runtime = new $RuntimeOptions{};
  return submitCampaignWithOptions(request, runtime);
}

model SwitchToConferenceRequest {
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', description='This parameter is required.', example='job-24114064019637****'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model SwitchToConferenceResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelFlags?: string(name='ChannelFlags', example='MONITORING'),
          channelId?: string(name='ChannelId', example='ch:user:131888****->8001****:1609225718294:job-6538214103685****'),
          channelState?: string(name='ChannelState', example='NONE'),
          destination?: string(name='Destination', example='8001****'),
          index?: int32(name='Index', example='1'),
          jobId?: string(name='JobId', example='job-6538214103685****'),
          originator?: string(name='Originator', example='1318888****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
          timestamp?: long(name='Timestamp', example='1609255716900'),
          userExtension?: string(name='UserExtension', example='8032****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      deviceState?: string(name='DeviceState', example='false'),
      extension?: string(name='Extension', example='8032****'),
      heartbeat?: long(name='Heartbeat', example='agent@ccc-test'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
      mobile?: string(name='Mobile', example='1324730****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='1609136956378'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='D9C96A73-09C9-5E2A-8CDB-85EC0BC246DA'),
}

model SwitchToConferenceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SwitchToConferenceResponseBody(name='body'),
}

/**
 * @param request SwitchToConferenceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SwitchToConferenceResponse
 */
async function switchToConferenceWithOptions(request: SwitchToConferenceRequest, runtime: $RuntimeOptions): SwitchToConferenceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SwitchToConference',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request SwitchToConferenceRequest
 * @return SwitchToConferenceResponse
 */
async function switchToConference(request: SwitchToConferenceRequest): SwitchToConferenceResponse {
  var runtime = new $RuntimeOptions{};
  return switchToConferenceWithOptions(request, runtime);
}

model TakeBreakRequest {
  code?: string(name='Code', description='This parameter is required.', example='lunchtime'),
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model TakeBreakResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    breakCode?: string(name='BreakCode', example='lunchtime'),
    deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
    extension?: string(name='Extension', example='8001****'),
    heartbeat?: long(name='Heartbeat', example='1609249563836'),
    instanceId?: string(name='InstanceId', example='ccc-test'),
    jobId?: string(name='JobId'),
    mobile?: string(name='Mobile', example='1390000****'),
    outboundScenario?: boolean(name='OutboundScenario', example='false'),
    reserved?: long(name='Reserved', example='1609234221864'),
    signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
    userId?: string(name='UserId', example='agent@ccc-test'),
    userState?: string(name='UserState', example='BREAK'),
    workMode?: string(name='WorkMode', example='ON_SITE'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='B59382D2-5755-4C6D-861F-FA2AAD8F89F7'),
}

model TakeBreakResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TakeBreakResponseBody(name='body'),
}

/**
 * @param request TakeBreakRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TakeBreakResponse
 */
async function takeBreakWithOptions(request: TakeBreakRequest, runtime: $RuntimeOptions): TakeBreakResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.code)) {
    query['Code'] = request.code;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'TakeBreak',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request TakeBreakRequest
 * @return TakeBreakResponse
 */
async function takeBreak(request: TakeBreakRequest): TakeBreakResponse {
  var runtime = new $RuntimeOptions{};
  return takeBreakWithOptions(request, runtime);
}

model TerminateTicketRequest {
  comment?: string(name='Comment'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  ticketId?: string(name='TicketId', example='5491d3b4-14ee-4341-b5f1-db2c78beddeb'),
}

model TerminateTicketResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: any(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='03C67DAD-EB26-41D8-949D-9B0C470FB716'),
}

model TerminateTicketResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TerminateTicketResponseBody(name='body'),
}

/**
 * @param request TerminateTicketRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TerminateTicketResponse
 */
async function terminateTicketWithOptions(request: TerminateTicketRequest, runtime: $RuntimeOptions): TerminateTicketResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.comment)) {
    query['Comment'] = request.comment;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ticketId)) {
    query['TicketId'] = request.ticketId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'TerminateTicket',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request TerminateTicketRequest
 * @return TerminateTicketResponse
 */
async function terminateTicket(request: TerminateTicketRequest): TerminateTicketResponse {
  var runtime = new $RuntimeOptions{};
  return terminateTicketWithOptions(request, runtime);
}

model TransferTicketTaskRequest {
  assignee?: string(name='Assignee', description='This parameter is required.', example='assignee@ccc-test'),
  comment?: string(name='Comment'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  taskId?: string(name='TaskId', example='f780ade8-3ca9-458b-b067-63077946a570'),
  ticketId?: string(name='TicketId', example='5491d3b4-14ee-4341-b5f1-db2c78beddeb'),
}

model TransferTicketTaskResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: any(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='678F7002-CA01-4ABF-A112-585AFBDF3A3B'),
}

model TransferTicketTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TransferTicketTaskResponseBody(name='body'),
}

/**
 * @param request TransferTicketTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TransferTicketTaskResponse
 */
async function transferTicketTaskWithOptions(request: TransferTicketTaskRequest, runtime: $RuntimeOptions): TransferTicketTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.assignee)) {
    query['Assignee'] = request.assignee;
  }
  if (!$isNull(request.comment)) {
    query['Comment'] = request.comment;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!$isNull(request.ticketId)) {
    query['TicketId'] = request.ticketId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'TransferTicketTask',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request TransferTicketTaskRequest
 * @return TransferTicketTaskResponse
 */
async function transferTicketTask(request: TransferTicketTaskRequest): TransferTicketTaskResponse {
  var runtime = new $RuntimeOptions{};
  return transferTicketTaskWithOptions(request, runtime);
}

model UnmuteCallRequest {
  channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-6538214103685****'),
  deviceId?: string(name='DeviceId', example='device'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  jobId?: string(name='JobId', example='job-6538214103685****'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model UnmuteCallResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    callContext?: {
      callType?: string(name='CallType', example='OUTBOUND'),
      channelContexts?: [ 
        {
          callType?: string(name='CallType', example='OUTBOUND'),
          channelFlags?: string(name='ChannelFlags', example='MONITORING'),
          channelId?: string(name='ChannelId', example='ch:user:1390501****->8032****:1609138902226:job-6538214103685****'),
          channelState?: string(name='ChannelState', example='CREATED'),
          destination?: string(name='Destination', example='1390501****'),
          index?: int32(name='Index', example='1'),
          jobId?: string(name='JobId', example='job-6538214103685****'),
          originator?: string(name='Originator', example='0830019****'),
          releaseInitiator?: string(name='ReleaseInitiator', example='1390501****'),
          releaseReason?: string(name='ReleaseReason', example='404 - No destination'),
          skillGroupId?: string(name='SkillGroupId', example='skillgroup@ccc-test'),
          timestamp?: long(name='Timestamp', example='1609138903315'),
          userExtension?: string(name='UserExtension', example='8032****'),
          userId?: string(name='UserId', example='agent@ccc-test'),
        }
      ](name='ChannelContexts'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
    }(name='CallContext'),
    userContext?: {
      breakCode?: string(name='BreakCode', example='Warm-up'),
      deviceId?: string(name='DeviceId', example='ACC-YUNBS-1.0.10-****'),
      extension?: string(name='Extension', example='8032****'),
      heartbeat?: long(name='Heartbeat', example='1609136956378'),
      instanceId?: string(name='InstanceId', example='ccc-test'),
      jobId?: string(name='JobId', example='job-6538214103685****'),
      mobile?: string(name='Mobile', example='1324730****'),
      outboundScenario?: boolean(name='OutboundScenario', example='false'),
      signedSkillGroupIdList?: [ string ](name='SignedSkillGroupIdList'),
      userId?: string(name='UserId', example='agent@ccc-test'),
      userState?: string(name='UserState', example='TALKING'),
      workMode?: string(name='WorkMode', example='ON_SITE'),
    }(name='UserContext'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='EEEE671A-3E24-4A04-81E6-6C4F5B39DF75'),
}

model UnmuteCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnmuteCallResponseBody(name='body'),
}

/**
 * @param request UnmuteCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnmuteCallResponse
 */
async function unmuteCallWithOptions(request: UnmuteCallRequest, runtime: $RuntimeOptions): UnmuteCallResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.channelId)) {
    query['ChannelId'] = request.channelId;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UnmuteCall',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UnmuteCallRequest
 * @return UnmuteCallResponse
 */
async function unmuteCall(request: UnmuteCallRequest): UnmuteCallResponse {
  var runtime = new $RuntimeOptions{};
  return unmuteCallWithOptions(request, runtime);
}

model UnregisterDeviceRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  userId?: string(name='UserId', example='agent@ccc-test'),
}

model UnregisterDeviceResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BA03159C-E808-4FF1-B27E-A61B6E888D7F'),
}

model UnregisterDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnregisterDeviceResponseBody(name='body'),
}

/**
 * @summary 删除注册设备
 *
 * @param request UnregisterDeviceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnregisterDeviceResponse
 */
async function unregisterDeviceWithOptions(request: UnregisterDeviceRequest, runtime: $RuntimeOptions): UnregisterDeviceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UnregisterDevice',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除注册设备
 *
 * @param request UnregisterDeviceRequest
 * @return UnregisterDeviceResponse
 */
async function unregisterDevice(request: UnregisterDeviceRequest): UnregisterDeviceResponse {
  var runtime = new $RuntimeOptions{};
  return unregisterDeviceWithOptions(request, runtime);
}

model UpdateCallSummaryRequest {
  context?: string(name='Context'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  ticketId?: string(name='TicketId', description='This parameter is required.', example='f2c6722b-cd13-442d-bf10-22a07c70d6d5'),
}

model UpdateCallSummaryResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: any(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='9FBA26B0-462B-4D77-B78F-AF35560DBC71'),
}

model UpdateCallSummaryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCallSummaryResponseBody(name='body'),
}

/**
 * @param request UpdateCallSummaryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCallSummaryResponse
 */
async function updateCallSummaryWithOptions(request: UpdateCallSummaryRequest, runtime: $RuntimeOptions): UpdateCallSummaryResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.context)) {
    query['Context'] = request.context;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ticketId)) {
    query['TicketId'] = request.ticketId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateCallSummary',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UpdateCallSummaryRequest
 * @return UpdateCallSummaryResponse
 */
async function updateCallSummary(request: UpdateCallSummaryRequest): UpdateCallSummaryResponse {
  var runtime = new $RuntimeOptions{};
  return updateCallSummaryWithOptions(request, runtime);
}

model UpdateCampaignRequest {
  callableTime?: string(name='CallableTime', example='[
      {
            "beginTime": "09:00:00",
            "endTime": "12:00:00"
      }
]'),
  campaignId?: string(name='CampaignId', description='This parameter is required.', example='ab11908b-6ebc-4b0c-b51e-3e17c7060'),
  contactFlowId?: string(name='ContactFlowId', example='3a310f56-4d30-4081-ba24-5d87a3b7262e'),
  endTime?: string(name='EndTime', example='1689933600000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  name?: string(name='Name'),
  startTime?: string(name='StartTime', example='1689901200000'),
  strategyParameters?: string(name='StrategyParameters'),
}

model UpdateCampaignResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='BC976D32-AC4C-4E0F-8AA9-F4BC6C4E2B3E'),
}

model UpdateCampaignResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCampaignResponseBody(name='body'),
}

/**
 * @summary Update campaign
 *
 * @param request UpdateCampaignRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCampaignResponse
 */
async function updateCampaignWithOptions(request: UpdateCampaignRequest, runtime: $RuntimeOptions): UpdateCampaignResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.callableTime)) {
    query['CallableTime'] = request.callableTime;
  }
  if (!$isNull(request.campaignId)) {
    query['CampaignId'] = request.campaignId;
  }
  if (!$isNull(request.contactFlowId)) {
    query['ContactFlowId'] = request.contactFlowId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.strategyParameters)) {
    query['StrategyParameters'] = request.strategyParameters;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateCampaign',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Update campaign
 *
 * @param request UpdateCampaignRequest
 * @return UpdateCampaignResponse
 */
async function updateCampaign(request: UpdateCampaignRequest): UpdateCampaignResponse {
  var runtime = new $RuntimeOptions{};
  return updateCampaignWithOptions(request, runtime);
}

model UpdateChatRoutingProfileRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='9cfad875-6260-4a53-ab6e-b13e3fb31f7d'),
  routingProfiles?: string(name='RoutingProfiles', description='This parameter is required.', example='{
    "RoutingType": "Automatic",
    "AgentConcurrencySettings": {
        "AllowExceedingLimitWhenTransferring": false,
        "ConcurrencyLimit": 4,
        "AllowExceedingLimitWhenClaiming": true,
        "Enabled": true
    },
    "ChatSettings": {
        "IdleChatTimeoutSeconds": 300
    },
    "DistributionSettings": {
        "Enabled": true,
        "AgentRingTimeoutSeconds": 119,
        "MaxNumberOfConversationsAgentCanMiss": 5,
        "PostAgentMissingConversionsAction": "Nothing"
    }
}'),
}

model UpdateChatRoutingProfileResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='BC976D32-AC4C-4E0F-8AA9-F4BC6C4E2B3E'),
}

model UpdateChatRoutingProfileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateChatRoutingProfileResponseBody(name='body'),
}

/**
 * @param request UpdateChatRoutingProfileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateChatRoutingProfileResponse
 */
async function updateChatRoutingProfileWithOptions(request: UpdateChatRoutingProfileRequest, runtime: $RuntimeOptions): UpdateChatRoutingProfileResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.routingProfiles)) {
    query['RoutingProfiles'] = request.routingProfiles;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateChatRoutingProfile',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UpdateChatRoutingProfileRequest
 * @return UpdateChatRoutingProfileResponse
 */
async function updateChatRoutingProfile(request: UpdateChatRoutingProfileRequest): UpdateChatRoutingProfileResponse {
  var runtime = new $RuntimeOptions{};
  return updateChatRoutingProfileWithOptions(request, runtime);
}

model UpdateConfigItemsRequest {
  configItems?: string(name='ConfigItems', description='This parameter is required.', example='[{"name":"ShowCalledID","value":"-1"},{"name":"ShowCalleeID","value":"1"},{"name":"AllowHangup","value":"0"},{"name":"AutoAnswerCall","value":"-1"},{"name":"AllowAudioDownload","value":"1"},{"name":"AllowChooseSignedSkillGroup","value":"1"}]'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  objectId?: string(name='ObjectId', description='This parameter is required.', example='ccc-test'),
  objectType?: string(name='ObjectType', description='This parameter is required.', example='INSTANCE'),
}

model UpdateConfigItemsResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='8E7Y5B39-3E24-4A04-81E6-6C4F5B39DF75'),
}

model UpdateConfigItemsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateConfigItemsResponseBody(name='body'),
}

/**
 * @param request UpdateConfigItemsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateConfigItemsResponse
 */
async function updateConfigItemsWithOptions(request: UpdateConfigItemsRequest, runtime: $RuntimeOptions): UpdateConfigItemsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.configItems)) {
    query['ConfigItems'] = request.configItems;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.objectId)) {
    query['ObjectId'] = request.objectId;
  }
  if (!$isNull(request.objectType)) {
    query['ObjectType'] = request.objectType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateConfigItems',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UpdateConfigItemsRequest
 * @return UpdateConfigItemsResponse
 */
async function updateConfigItems(request: UpdateConfigItemsRequest): UpdateConfigItemsResponse {
  var runtime = new $RuntimeOptions{};
  return updateConfigItemsWithOptions(request, runtime);
}

model UpdateSchemaPropertyRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='b0eb2742-f37e-4c67-82d4-25c651c1xxxx'),
  property?: {
    array?: boolean(name='Array', example='false'),
    attributes?: string(name='Attributes', example='{\\\\"instanceId\\\\":\\\\"4cc3f160-ca64-49ff-bc70-390a044a4e83\\\\",\\\\"appId\\\\":\\\\"1684145288664\\\\",\\\\"commodityCode\\\\":\\\\"dide_pre\\\\",\\\\"dide_pre_set\\\\":\\\\"version_ent\\\\"}'),
    dataType?: string(name='DataType', description='This parameter is required.', example='string'),
    description?: string(name='Description', example='-'),
    disabled?: boolean(name='Disabled', example='true'),
    displayName?: string(name='DisplayName'),
    displayOrder?: int32(name='DisplayOrder', example='10'),
    editorType?: string(name='EditorType', example='textbox'),
    maxLength?: int32(name='MaxLength', example='100'),
    maximum?: double(name='Maximum', example='11'),
    minLength?: int32(name='MinLength', example='1'),
    minimum?: double(name='Minimum', example='10800'),
    name?: string(name='Name', description='This parameter is required.', example='name'),
    pattern?: string(name='Pattern', example='(.*)'),
    patternErrorMessage?: string(name='PatternErrorMessage'),
    readOnly?: boolean(name='ReadOnly', example='true'),
    required?: boolean(name='Required', example='false'),
  }(name='Property'),
  requestId?: string(name='RequestId', example='BC976D32-AC4C-4E0F-8AA9-F4BC6C4E2B3E'),
  schemaId?: string(name='SchemaId', description='schema id

This parameter is required.', example='profile'),
}

model UpdateSchemaPropertyShrinkRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='b0eb2742-f37e-4c67-82d4-25c651c1xxxx'),
  propertyShrink?: string(name='Property'),
  requestId?: string(name='RequestId', example='BC976D32-AC4C-4E0F-8AA9-F4BC6C4E2B3E'),
  schemaId?: string(name='SchemaId', description='schema id

This parameter is required.', example='profile'),
}

model UpdateSchemaPropertyResponseBody = {
  code?: string(name='Code', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='A450574A-337F-43E2-BC59-9C6594C994C6'),
}

model UpdateSchemaPropertyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateSchemaPropertyResponseBody(name='body'),
}

/**
 * @param tmpReq UpdateSchemaPropertyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateSchemaPropertyResponse
 */
async function updateSchemaPropertyWithOptions(tmpReq: UpdateSchemaPropertyRequest, runtime: $RuntimeOptions): UpdateSchemaPropertyResponse {
  tmpReq.validate();
  var request = new UpdateSchemaPropertyShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.property)) {
    request.propertyShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.property, 'Property', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.propertyShrink)) {
    body['Property'] = request.propertyShrink;
  }
  if (!$isNull(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  if (!$isNull(request.schemaId)) {
    body['SchemaId'] = request.schemaId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateSchemaProperty',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UpdateSchemaPropertyRequest
 * @return UpdateSchemaPropertyResponse
 */
async function updateSchemaProperty(request: UpdateSchemaPropertyRequest): UpdateSchemaPropertyResponse {
  var runtime = new $RuntimeOptions{};
  return updateSchemaPropertyWithOptions(request, runtime);
}

model UpdateTicketRequest {
  context?: string(name='Context'),
  customerId?: string(name='CustomerId', example='51e155ce-***-****-b402-13c69597b920'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  ticketId?: string(name='TicketId', description='This parameter is required.', example='5491d3b4-14ee-4341-b5f1-db2c78beddeb'),
  title?: string(name='Title'),
}

model UpdateTicketResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: any(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='7BEEA660-A45A-45E3-98CC-AFC65E715C23'),
}

model UpdateTicketResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateTicketResponseBody(name='body'),
}

/**
 * @param request UpdateTicketRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateTicketResponse
 */
async function updateTicketWithOptions(request: UpdateTicketRequest, runtime: $RuntimeOptions): UpdateTicketResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.context)) {
    query['Context'] = request.context;
  }
  if (!$isNull(request.customerId)) {
    query['CustomerId'] = request.customerId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ticketId)) {
    query['TicketId'] = request.ticketId;
  }
  if (!$isNull(request.title)) {
    query['Title'] = request.title;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateTicket',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UpdateTicketRequest
 * @return UpdateTicketResponse
 */
async function updateTicket(request: UpdateTicketRequest): UpdateTicketResponse {
  var runtime = new $RuntimeOptions{};
  return updateTicketWithOptions(request, runtime);
}

model WithdrawTicketRequest {
  comment?: string(name='Comment', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc-test'),
  ticketId?: string(name='TicketId', description='This parameter is required.', example='5491d3b4-14ee-4341-b5f1-db2c78beddeb'),
}

model WithdrawTicketResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: any(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  params?: [ string ](name='Params'),
  requestId?: string(name='RequestId', example='2778FA12-EDD6-42AA-9B15-AF855072E5E5'),
}

model WithdrawTicketResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WithdrawTicketResponseBody(name='body'),
}

/**
 * @param request WithdrawTicketRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return WithdrawTicketResponse
 */
async function withdrawTicketWithOptions(request: WithdrawTicketRequest, runtime: $RuntimeOptions): WithdrawTicketResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.comment)) {
    query['Comment'] = request.comment;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ticketId)) {
    query['TicketId'] = request.ticketId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'WithdrawTicket',
    version = '2020-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request WithdrawTicketRequest
 * @return WithdrawTicketResponse
 */
async function withdrawTicket(request: WithdrawTicketRequest): WithdrawTicketResponse {
  var runtime = new $RuntimeOptions{};
  return withdrawTicketWithOptions(request, runtime);
}

